Skip to content
Snippets Groups Projects
Commit a18fe0b9 authored by Armin Luntzer's avatar Armin Luntzer
Browse files

vsnprintf: insert termination in proper location

parent 93aa12ef
No related branches found
No related tags found
No related merge requests found
......@@ -1290,7 +1290,7 @@ int vsnprintf(char *str, size_t size, const char *format, va_list ap)
/* have we arrived at the end? */
if (!(*format))
break;
break;
/* we have encountered a format specifier, try to evaluate it */
format++;
......@@ -1310,7 +1310,7 @@ int vsnprintf(char *str, size_t size, const char *format, va_list ap)
if (size) {
if (str) {
if (buf < end)
buf[0] = '\0';
buf[-1] = '\0';
else
end[-1] = '\0';
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment