> compile NEMU

221220000 张三
Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
 22:54:31 up 13:34,  1 user,  load average: 0.29, 0.22, 0.19
This commit is contained in:
tracer-ics2023
2024-09-11 22:54:32 +08:00
committed by zzy
parent 1a1d812dda
commit 257dedabb6

View File

@ -57,8 +57,10 @@ static int print_fmt(char **out, int n, const char** fmt, va_list ap) {
char buf[sizeof(num) * 3];
if (num == 0) {
buf[i++] = '0';
ret = 1;
break;
}
for (i = 0; num; i ++) {
for (i = 1; num; i ++) {
buf[i] = '0' + num % 10;
num /= 10;
}
@ -68,7 +70,7 @@ static int print_fmt(char **out, int n, const char** fmt, va_list ap) {
ret = i;
// reverse buf
for (i --; i >= 0; i --, (*out) ++ ) {
for (i --; i > 0; i --, (*out) ++ ) {
**out = buf[i];
}
break;