Don't write a NULL terminator at the end of the buffer

* Note: we do write a NULL terminator after the data (even if it's
  truncated) we just don't want to write it at the end of the buffer too
This commit is contained in:
baldurk
2017-08-29 13:19:46 +01:00
parent 9f1e830b50
commit 8739c39f08
-2
View File
@@ -1127,8 +1127,6 @@ int utf8printf(char *buf, size_t bufsize, const char *fmt, va_list args)
size_t actualsize = 0;
char *output = buf;
char *end = buf ? buf + bufsize - 1 : NULL;
if(end)
*end = 0;
const char *iter = fmt;