diff options
author | pgen <p.gen.progs@gmail.com> | 2022-03-16 22:19:46 +0100 |
---|---|---|
committer | pgen <p.gen.progs@gmail.com> | 2022-03-16 22:19:46 +0100 |
commit | 4180e49bbf2240994fda51d9840027c7deeb1465 (patch) | |
tree | a2b45c645e5ddb47772f291deec5132054b2b748 /xmalloc.c | |
parent | 7f2dc2bdabc3f33f7eadce3469e6220e0d2db164 (diff) |
Use the right format to print size_t values (C99)
Diffstat (limited to 'xmalloc.c')
-rw-r--r-- | xmalloc.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -67,8 +67,7 @@ xmalloc(size_t size) if (allocated == NULL) { fprintf(stderr, - "Error: Insufficient memory (attempt to malloc %lu bytes)\n", - (unsigned long int)size); + "Error: Insufficient memory (attempt to malloc %zu bytes)\n", size); exit(EXIT_FAILURE); } @@ -91,8 +90,7 @@ xcalloc(size_t n, size_t size) if (allocated == NULL) { fprintf(stderr, - "Error: Insufficient memory (attempt to calloc %lu bytes)\n", - (unsigned long int)size); + "Error: Insufficient memory (attempt to calloc %zu bytes)\n", size); exit(EXIT_FAILURE); } @@ -113,8 +111,8 @@ xrealloc(void * p, size_t size) if (allocated == NULL && size > 0) { fprintf(stderr, - "Error: Insufficient memory (attempt to xrealloc %lu bytes)\n", - (unsigned long int)size); + "Error: Insufficient memory (attempt to xrealloc %zu bytes)\n", + size); exit(EXIT_FAILURE); } |