1 /* reimplementation of alloc_re by djb@cr.yp.to.
2  * placed in the public domain by uwe@ohse.de
3  */
4 #include "alloc.h"
5 #include "byte.h"
6 
7 int
alloc_re(char ** old,unsigned int oldsize,unsigned int newsize)8 alloc_re(char **old, unsigned int oldsize, unsigned int newsize)
9 {
10 	char *neu; /* hate c++ */
11 
12 	neu = alloc(newsize);
13 	if (!neu) return 0;
14 	byte_copy(neu,oldsize,*old);
15 	alloc_free(*old);
16 	*old = neu;
17 	return 1;
18 }
19