(vsnprintf): don't write the NUL into the string if the length was 0
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15031 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -688,7 +688,7 @@ vsnprintf (char *str, size_t sz, const char *format, va_list args)
|
||||
state.append_char = sn_append_char;
|
||||
|
||||
ret = xyzprintf (&state, format, args);
|
||||
if (state.s != NULL)
|
||||
if (state.s != NULL && sz != 0)
|
||||
*state.s = '\0';
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user