diff options
author | Kenneth Fyfe <kenfyfe@conkersoft.co.uk> | 2006-01-14 23:51:59 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2006-01-16 10:26:04 -0800 |
commit | a16afeb49ad4daa97f895a98ac42d551785fff54 (patch) | |
tree | b7a915596c40c4f05619c48e93a50c0acf705f65 | |
parent | aad150e5df7c229962d16fb5936901b9ea970b59 (diff) | |
download | syslinux-3.20-pre5.tar.gz |
com32's realloc functionsyslinux-3.20-pre5
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.
-rw-r--r-- | com32/lib/realloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/com32/lib/realloc.c b/com32/lib/realloc.c index 577c2001..67a27834 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); |