fixed off-by-one bug in buffer_add_str()

This commit is contained in:
Thomas von Dein
2016-10-26 08:23:34 +02:00
parent 56f35a66d8
commit 5255a076db

View File

@@ -95,7 +95,7 @@ void buffer_add_str(Buffer *b, const char * fmt, ...) {
if(vasprintf(&dst, fmt, ap) >= 0) {
if(b->end > 0)
b->end--;
buffer_add(b, dst, strlen(dst)+1);
buffer_add(b, dst, strlen(dst));
}
va_end(ap);
free(dst);