hey, thank you for the brain touch,
----- "Mathieu Bouchard" matju@artengine.ca a écrit :
On Thu, 13 May 2010, Hans-Christoph Steiner wrote:
Or maybe: binbuf_gettext(bb, &buf, &bufsize); strncat(buf, "\0", strlen(buf)-bufsize);
this is appending extra characters when [print] argument has more than seven characters.
eg:
match: bang NO_matchmÇ&: 234
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; }