> 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
 08:54:25 up 2 days, 21:18,  3 users,  load average: 0.49, 0.25, 0.22
This commit is contained in:
tracer-ics2023
2024-09-08 08:54:25 +08:00
committed by zzy
parent 02cffaedc5
commit 4534458624

View File

@ -94,11 +94,12 @@ static int rvsnprintf(char* out, size_t n, const char* fmt, va_list ap) {
char* _out = out;
size_t _n = n;
const char* _fmt = fmt;
for (; n; _fmt ++, _out ++, _n --) {
bool end = false;
for (; n && !end; _fmt ++, _out ++, _n --) {
switch (*_fmt) {
case '\0':
*_out = *_fmt;
goto END;
end = true;
case '%':
_fmt ++;
int len = fmt_match(_out, _n, _fmt, ap);
@ -110,8 +111,6 @@ static int rvsnprintf(char* out, size_t n, const char* fmt, va_list ap) {
break;
}
}
END:
assert(strlen(out) + 1 == n - _n);
assert(*out == '\0');
return 0;
}