Return value of _vsnprintf and _vswprintf should not be counting the null terminator.

This commit is contained in:
gibbed 2014-01-17 18:48:02 -08:00
parent cd8c081ee6
commit 441013770d
1 changed files with 2 additions and 2 deletions

View File

@ -223,7 +223,7 @@ SHIM_CALL _vsnprintf_shim(
} }
format = end; format = end;
} }
*b++ = '\0'; *b = '\0';
SHIM_SET_RETURN((uint32_t)(b - buffer)); SHIM_SET_RETURN((uint32_t)(b - buffer));
} }
@ -438,7 +438,7 @@ SHIM_CALL _vswprintf_shim(
} }
format = end; format = end;
} }
*b++ = '\0'; *b = '\0';
// swap the result buffer // swap the result buffer
for (wchar_t* swap = buffer; swap != b; ++swap) for (wchar_t* swap = buffer; swap != b; ++swap)