diff --git a/lib/darr.c b/lib/darr.c index 4f3bd9fb67ab..7dcc6d3fabff 100644 --- a/lib/darr.c +++ b/lib/darr.c @@ -77,7 +77,7 @@ char *__darr_in_vsprintf(char **sp, bool concat, const char *fmt, va_list ap) else if ((size_t)len < darr_avail(*sp)) _darr_len(*sp) += len; else { - darr_ensure_cap(*sp, darr_len(*sp) + (size_t)len); + darr_ensure_cap(*sp, darr_len(*sp) + (size_t)len + 1); goto again; } return *sp;