From 441013770d6cc907ce5b1ac0545c1bd088a5e1f7 Mon Sep 17 00:00:00 2001 From: gibbed Date: Fri, 17 Jan 2014 18:48:02 -0800 Subject: [PATCH] Return value of _vsnprintf and _vswprintf should not be counting the null terminator. --- src/xenia/kernel/xboxkrnl_strings.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xenia/kernel/xboxkrnl_strings.cc b/src/xenia/kernel/xboxkrnl_strings.cc index 8a6dbcdd7..4d92652b1 100644 --- a/src/xenia/kernel/xboxkrnl_strings.cc +++ b/src/xenia/kernel/xboxkrnl_strings.cc @@ -223,7 +223,7 @@ SHIM_CALL _vsnprintf_shim( } format = end; } - *b++ = '\0'; + *b = '\0'; SHIM_SET_RETURN((uint32_t)(b - buffer)); } @@ -438,7 +438,7 @@ SHIM_CALL _vswprintf_shim( } format = end; } - *b++ = '\0'; + *b = '\0'; // swap the result buffer for (wchar_t* swap = buffer; swap != b; ++swap)