> 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
 21:56:15 up 7 days,  6:53,  1 user,  load average: 0.44, 0.72, 0.84
This commit is contained in:
tracer-ics2023
2024-09-24 21:56:17 +08:00
committed by zzy
parent 548faeaea0
commit 47045806c6
2 changed files with 3 additions and 4 deletions

View File

@ -73,12 +73,12 @@ static inline int print_fmt(char **out, int n, const char** fmt, va_list (*ap))
}
int rvsnprintf(char* out, size_t n, const char* fmt, va_list ap) {
int ret = 0;
int ret = n;
while(*fmt && n) {
if (*fmt == '%') {
// FIXME
fmt++;
print_fmt(&out, n, &fmt, (va_list*)&ap);
n -= print_fmt(&out, n, &fmt, (va_list*)&ap);
continue;
}
*out = *fmt;
@ -87,7 +87,7 @@ int rvsnprintf(char* out, size_t n, const char* fmt, va_list ap) {
n --;
}
*out = '\0';
return ret;
return ret - n;
}
#endif

View File

@ -27,7 +27,6 @@ size_t events_read(void *buf, size_t offset, size_t len) {
if (kb.keycode == AM_KEY_NONE) {
return 0;
}
TRACE("key %s\n", keyname[kb.keycode]);
return snprintf(buf, len, "%s %s\n", kb.keydown ? "kd" : "ku", keyname[kb.keycode]);
}