In case of error allow portable printing of 64bit integers
This commit is contained in:
parent
9007ffab23
commit
b00d8daf58
|
|
@ -75,7 +75,7 @@ tmalloc(size_t num)
|
||||||
mutex_unlock(&allocMutex);
|
mutex_unlock(&allocMutex);
|
||||||
#endif
|
#endif
|
||||||
if (!s){
|
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");
|
fprintf(stderr, " Not enough memory or heap corruption\n");
|
||||||
#if defined HAS_WINGUI || defined SHARED_MODULE
|
#if defined HAS_WINGUI || defined SHARED_MODULE
|
||||||
controlled_exit(EXIT_FAILURE);
|
controlled_exit(EXIT_FAILURE);
|
||||||
|
|
@ -120,7 +120,7 @@ trealloc(const void *ptr, size_t num)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (!s) {
|
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");
|
fprintf(stderr," Not enough memory or heap corruption\n");
|
||||||
#if defined HAS_WINGUI || defined SHARED_MODULE
|
#if defined HAS_WINGUI || defined SHARED_MODULE
|
||||||
controlled_exit(EXIT_FAILURE);
|
controlled_exit(EXIT_FAILURE);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue