In case of error allow portable printing of 64bit integers

This commit is contained in:
Holger Vogt 2026-04-28 11:43:27 +02:00
parent 9007ffab23
commit b00d8daf58
1 changed files with 2 additions and 2 deletions

View File

@ -75,7 +75,7 @@ tmalloc(size_t num)
mutex_unlock(&allocMutex);
#endif
if (!s){
fprintf(stderr, "Error: malloc: can't allocate %lld bytes.\n", (long long)num);
fprintf(stderr, "Error: malloc: can't allocate %zu bytes.\n", num);
fprintf(stderr, " Not enough memory or heap corruption\n");
#if defined HAS_WINGUI || defined SHARED_MODULE
controlled_exit(EXIT_FAILURE);
@ -120,7 +120,7 @@ trealloc(const void *ptr, size_t num)
#endif
}
if (!s) {
fprintf(stderr,"Error: realloc: can't allocate %lld bytes.\n", (long long)num);
fprintf(stderr,"Error: realloc: can't allocate %zu bytes.\n", num);
fprintf(stderr," Not enough memory or heap corruption\n");
#if defined HAS_WINGUI || defined SHARED_MODULE
controlled_exit(EXIT_FAILURE);