1 /* 2 * reimplementation of Daniel Bernstein's unix library. 3 * placed in the public domain by Uwe Ohse, uwe@ohse.de. 4 */ 5 #include "stralloc.h" 6 #include "byte.h" 7 8 int stralloc_copyb(stralloc * sa,const char * src,unsigned int n)9stralloc_copyb (stralloc * sa, const char *src, unsigned int n) 10 { 11 if (!stralloc_ready (sa, n + 1)) 12 return 0; 13 byte_copy (sa->s, n, src); 14 sa->len = n; 15 sa->s[n] = 'Z'; /* ``offensive programming'', indeed */ 16 return 1; 17 } 18