Trim the newline at the end of stdout output.

Makes the log a bit easier to read.
This commit is contained in:
Unknown W. Brackets 2013-04-09 23:26:27 -07:00
parent 1f1560a9d6
commit ff8c128d20

View File

@ -507,18 +507,11 @@ u32 sceIoReadAsync(int id, u32 data_addr, int size) {
}
int __IoWrite(int id, void *data_ptr, int size) {
if (id == 2) {
//stderr!
const char *str = (const char*) data_ptr;
INFO_LOG(HLE, "stderr: %s", str);
return size;
} else if (id == 1) {
//stdout!
char *str = (char *) data_ptr;
char temp = str[size];
str[size] = 0;
INFO_LOG(HLE, "stdout: %s", str);
str[size] = temp;
// Let's handle stdout/stderr specially.
if (id == 1 || id == 2) {
const char *str = (const char *) data_ptr;
const int str_size = size == 0 ? 0 : (str[size - 1] == '\n' ? size - 1 : size);
INFO_LOG(HLE, "%s: %.*s", id == 1 ? "stdout" : "stderr", str_size, str);
return size;
}
u32 error;