From 203cca8dffe0b786d9daac74c6fe9c1f81fdda12 Mon Sep 17 00:00:00 2001 From: starnakin Date: Sat, 7 Sep 2024 00:40:36 +0200 Subject: [PATCH] fix: kvprintf, add return value --- src/kprint/kvprintf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kprint/kvprintf.c b/src/kprint/kvprintf.c index b4dcfc0..1730928 100644 --- a/src/kprint/kvprintf.c +++ b/src/kprint/kvprintf.c @@ -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; } \ No newline at end of file