From 7f8d34504a33f9ca43a9191e26c561b3afc662ee Mon Sep 17 00:00:00 2001 From: Robear Selwans Date: Sun, 6 Oct 2024 23:43:07 +0300 Subject: [PATCH] Fixed issue with pushFmt producing incorrect output Signed-off-by: Robear Selwans --- ev_str.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ev_str.h b/ev_str.h index c18f718..6e3c12f 100644 --- a/ev_str.h +++ b/ev_str.h @@ -606,7 +606,7 @@ evstring_pushFmt_v( size_t old_len = evstring_getLength(*s); evstring_error_t res = evstring_setLength(s, old_len + fmt_len); if(res == EV_STR_ERR_NONE) { - int write_res = vsnprintf((*s) + old_len, fmt_len, fmt, args); + int write_res = vsnprintf((*s) + old_len, fmt_len+1, fmt, args); assert(write_res > 0); assert(write_res == fmt_len); }