From 5a13865385cf32e072c8dd69c5d6bf4adb6e4957 Mon Sep 17 00:00:00 2001 From: FRIGN Date: Mon, 16 Feb 2015 10:30:19 +0100 Subject: [PATCH] Fix \c behaviour The loop magic broke along the way. Just drop that and write a proper early exit (= termination). Now it should work as expected. --- printf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/printf.c b/printf.c index e57562c..3563790 100644 --- a/printf.c +++ b/printf.c @@ -102,7 +102,9 @@ main(int argc, char *argv[]) case 'b': if ((tmp = strstr(arg, "\\c"))) { *tmp = 0; - argi = argc; + unescape(arg); + fputs(arg, stdout); + return 0; } unescape(arg); fputs(arg, stdout);