insmod don't compile (was: Missing libbb/xrealloc_vector.c)

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Wed Jul 9 17:23:55 UTC 2008


On Wed, 9 Jul 2008, Cristian Ionescu-Idbohrn wrote:

> There seems to be more to it:
>
>   modutils/insmod.c: In function 'obj_allocate_commons':
>   modutils/insmod.c:3085: error: too many arguments to function 'xrealloc'

That line reads:

			f->sections = xrealloc(f->sections, 2, i);

that is 3 arguments, but the prototype is:

include/libbb.h:void *xrealloc(void *old, size_t size) FAST_FUNC;

only 2 arguments.

This patch fixes that error:

Index: modutils/insmod.c
===================================================================
--- modutils/insmod.c	(revision 22692)
+++ modutils/insmod.c	(working copy)
@@ -3082,7 +3082,7 @@
 		if (i == f->header.e_shnum) {
 			struct obj_section *sec;

-			f->sections = xrealloc(f->sections, 2, i);
+			f->sections = xrealloc_vector(f->sections, 2, i);
 			f->sections[i] = sec = arch_new_section();
 			f->header.e_shnum = i + 1;



Cheers,

-- 
Cristian



More information about the busybox mailing list