Fixed vsnprintf behavior when count < 0.
This commit is contained in:
parent
99718fd3ce
commit
065f0417f2
|
@ -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';
|
||||||
|
|
Loading…
Reference in New Issue