1 /*
2  * reimplementation of Daniel Bernstein's unix library.
3  * placed in the public domain by Uwe Ohse, uwe@ohse.de.
4  */
5 #include "gen_alloci.h"
6 #include "byte.h"
7 int
gen_alloc_append(char ** bptr,unsigned int bsize,unsigned int * len,unsigned int * a,const char * add)8 gen_alloc_append(char **bptr, unsigned int bsize, unsigned int *len,
9 	unsigned int *a, const char *add)
10 {
11 	if (!gen_alloc_ready(bptr,bsize,len,a, *len+1))
12 		return 0;
13 	byte_copy(*bptr+bsize*(*len),bsize,add); /* *len is now valid */
14 	(*len)++;
15 	return 1;
16 }
17