On Thu, 13 May 2010, Hans-Christoph Steiner wrote:
Or maybe: binbuf_gettext(bb, &buf, &bufsize); strncat(buf, "\0", strlen(buf)-bufsize);
strncat will copy at most strlen(buf)-bufsize, but it will also copy at most strlen("\0") bytes, and strlen("\0") is zero, because strlen actually is just
long strlen (const char *start) { const char *end = start; while (*end) end++; return end-start; }
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801