aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--printf.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/printf.c b/printf.c
index 8d7f56d..bfbd15c 100644
--- a/printf.c
+++ b/printf.c
@@ -157,18 +157,17 @@ int vsnprintf(char *buf, int size, const char *fmt, va_list va)
}
morefmt:
f = *fmt++;
- do {
if (f == '%') {
addchar(&s, '%');
- break;
+ continue;
}
if (f == 'c') {
addchar(&s, va_arg(va, int));
- break;
+ continue;
}
if (f == '\0') {
--fmt;
- break;
+ continue;
}
if (f == '0') {
props.pad = '0';
@@ -196,7 +195,7 @@ int vsnprintf(char *buf, int size, const char *fmt, va_list va)
panic();
break;
}
- break;
+ continue;
}
if (f == 'x') {
switch (nlong) {
@@ -210,20 +209,18 @@ int vsnprintf(char *buf, int size, const char *fmt, va_list va)
panic();
break;
}
- break;
+ continue;
}
if (f == 'p') {
print_str(&s, "0x", props);
print_unsigned(&s, (unsigned long)va_arg(va, void *), 16, props);
- break;
+ continue;
}
if (f == 's') {
print_str(&s, va_arg(va, const char *), props);
- break;
+ continue;
}
addchar(&s, f);
- break;
- } while(0);
}
*s.buffer = 0;
++s.added;