fix: kvprintf, add return value
This commit is contained in:
parent
a4350fa686
commit
203cca8dff
@ -24,13 +24,14 @@ int kvprintf(int level, const char *restrict format, va_list ap)
|
||||
const char *start = format;
|
||||
const char *flag;
|
||||
long padding;
|
||||
int ret = 0;
|
||||
|
||||
while (*start != '\0') {
|
||||
flag = strchr(start, '%');
|
||||
if (flag != NULL) {
|
||||
padding = atoll(start + 1);
|
||||
for (; isdigit(*padding); padding++);
|
||||
print_flag(*padding, ap);
|
||||
ret += print_flag(*padding, ap);
|
||||
start = padding + 1;
|
||||
}
|
||||
else {
|
||||
@ -38,4 +39,5 @@ int kvprintf(int level, const char *restrict format, va_list ap)
|
||||
start += strlen(start);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
Loading…
Reference in New Issue
Block a user