From 6f01a35b81ca7420881aa6dbe8b6b6b187402f68 Mon Sep 17 00:00:00 2001 From: sjborley Date: Sat, 21 May 2005 15:56:20 +0000 Subject: [PATCH] Fixed problems where printf format was int yet on some systems the argument is long (due to size_t being long). Fixed by always using long format and casting to long, rather than using the IS_SIZE_T_LONG macro to switch formats. --- src/misc/alloc.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/misc/alloc.c b/src/misc/alloc.c index e06f7e0f0..5dea5442f 100644 --- a/src/misc/alloc.c +++ b/src/misc/alloc.c @@ -1,5 +1,6 @@ /********** Copyright 1990 Regents of the University of California. All rights reserved. +$Id$ **********/ /* @@ -27,13 +28,7 @@ tmalloc(size_t num) return NULL; s = calloc(num,1); if (!s){ - fprintf(stderr, -#if IS_SIZE_T_LONG - "malloc: Internal Error: can't allocate %ld bytes. \n", -#else - "malloc: Internal Error: can't allocate %d bytes. \n", -#endif - num); + fprintf(stderr,"malloc: Internal Error: can't allocate %ld bytes. \n",(long)num); exit(EXIT_BAD); } return(s); @@ -56,13 +51,7 @@ trealloc(void *ptr, size_t num) s = realloc(ptr, num); if (!s) { - fprintf(stderr, -#if IS_SIZE_T_LONG - "realloc: Internal Error: can't allocate %ld bytes.\n", -#else - "realloc: Internal Error: can't allocate %d bytes.\n", -#endif - num); + fprintf(stderr,"realloc: Internal Error: can't allocate %ld bytes.\n",(long)num); exit(EXIT_BAD); } return(s);