Bug in imported sw :(

This commit is contained in:
Vitor Santos Costa 2016-04-22 18:22:50 +01:00
parent 768b17751b
commit b0766abb5c

View File

@ -86,7 +86,7 @@ mem_write (void *c, const char *buf, int n)
if (cookie->eof < cookie->pos)
memset (cbuf + cookie->eof, '\0', cookie->pos - cookie->eof);
memcpy (cbuf + cookie->pos, buf, n);
cookie->pos = n;
cookie->pos += n;
/* If the user has previously written beyond the current position,
remember what the trailing NUL is overwriting. Otherwise,
extend the stream. */