mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-27 15:30:35 +00:00
Trim the newline at the end of stdout output.
Makes the log a bit easier to read.
This commit is contained in:
parent
1f1560a9d6
commit
ff8c128d20
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user