summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-03-15 16:06:24 -0400
committerJakob Kaivo <jkk@ung.org>2019-03-15 16:06:24 -0400
commit123d0edac6679cc4dcfdf78650ba3d9db1330843 (patch)
tree04a655d460875e53e8465f886b2d8fc1be8618b5
parentb9f19d2493195fa9be3e5d0045a2c82dbac1a85a (diff)
exit directly from a %b \c escape, ease logic at outer loop
-rw-r--r--printf.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/printf.c b/printf.c
index 67bf279..62a826f 100644
--- a/printf.c
+++ b/printf.c
@@ -91,7 +91,7 @@ static const char *echo(const char *s)
s++;
if (*s == 'c') {
- return NULL;
+ exit(errors);
}
if (*s == '0' || !isdigit(*s)) {
@@ -272,10 +272,6 @@ int printf_main(int argc, char *argv[])
putchar(*format);
format++;
}
-
- if (format == NULL) {
- break;
- }
}
if (count == 0) {