Fixed vsnprintf behavior when count < 0.

This commit is contained in:
gibbed 2015-06-02 09:45:57 -05:00
parent 99718fd3ce
commit 065f0417f2
1 changed files with 1 additions and 2 deletions

View File

@ -868,8 +868,7 @@ SHIM_CALL _vsnprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
if (buffer_count > 0) { if (buffer_count > 0) {
buffer[0] = '\0'; // write a null, just to be safe buffer[0] = '\0'; // write a null, just to be safe
} }
} } else if (count <= buffer_count) {
if (count <= buffer_count) {
std::memcpy(buffer, data.str().c_str(), count); std::memcpy(buffer, data.str().c_str(), count);
if (count < buffer_count) { if (count < buffer_count) {
buffer[count] = '\0'; buffer[count] = '\0';