From: Kenneth Fyfe Date: Sat, 14 Jan 2006 23:51:59 +0000 (+0000) Subject: com32's realloc function X-Git-Tag: syslinux-3.20-pre5^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a16afeb49ad4daa97f895a98ac42d551785fff54;p=platform%2Fupstream%2Fsyslinux.git com32's realloc function Hello list, I've been playing with com32 programs lately and I've come across a a problem with the realloc function in libcom32. The code that rounds up the size looks to be missing a '~' operator, resulting in it truncating every request to a size of 0-15 bytes. The little patch below fixes it up to match the corresponding line in malloc, which makes it work for me. K. --- diff --git a/com32/lib/realloc.c b/com32/lib/realloc.c index 577c200..67a2783 100644 --- a/com32/lib/realloc.c +++ b/com32/lib/realloc.c @@ -24,7 +24,7 @@ void *realloc(void *ptr, size_t size) } /* Add the obligatory arena header, and round up */ - size = (size+2*sizeof(struct arena_header)-1) & ARENA_SIZE_MASK; + size = (size+2*sizeof(struct arena_header)-1) & ~ARENA_SIZE_MASK; ah = (struct free_arena_header *) ((struct arena_header *)ptr - 1);