From bc77dfb4927691f1d40018f3bf0853f24834aec8 Mon Sep 17 00:00:00 2001 From: Robert James Kaes Date: Thu, 31 Jul 2003 23:42:51 +0000 Subject: (debugging_realloc): Removed the assert for the NULL pointer, since realloc() can take a NULL pointer, as defined by the realloc() man page. Fixed the cast in both safefree() macros to compile cleaning using a C++ compiler. --- src/heap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/heap.c b/src/heap.c index 167147a..d8763b4 100644 --- a/src/heap.c +++ b/src/heap.c @@ -1,4 +1,4 @@ -/* $Id: heap.c,v 1.6 2003-06-26 18:14:13 rjkaes Exp $ +/* $Id: heap.c,v 1.7 2003-07-31 23:42:51 rjkaes Exp $ * * Debugging versions of various heap related functions are combined * here. The debugging versions include assertions and also print @@ -55,7 +55,6 @@ debugging_realloc(void *ptr, size_t size, const char *file, unsigned long line) { void *newptr; - assert(ptr != NULL); assert(size > 0); newptr = realloc(ptr, size); @@ -83,7 +82,7 @@ debugging_strdup(const char* s, const char* file, unsigned long line) assert(s != NULL); len = strlen(s) + 1; - ptr = malloc(len); + ptr = (char*)malloc(len); if (!ptr) return NULL; memcpy(ptr, s, len); -- cgit v1.2.3