fixed off-by-one error when opening stream

This commit is contained in:
overflowerror 2021-05-23 17:17:33 +02:00
parent a65f394284
commit 30c62e03b8

View file

@ -128,7 +128,7 @@ char* renderTemplateStr(const char* name, ...) {
return NULL;
}
FILE* out = fmemopen(result, length, "w");
FILE* out = fmemopen(result, length + 1, "w");
if (out == NULL) {
va_end(argptr2);
return NULL;