From 1fd55df7f9f16a701d9e184f5554ea6c0507a381 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 23 Apr 2008 09:02:15 +0100 Subject: figlet: Fix handling of full final line of octal output. It should not be terminated with a backslash. Signed-off-by: Keir Fraser --- xen/tools/figlet/figlet.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'xen/tools') diff --git a/xen/tools/figlet/figlet.c b/xen/tools/figlet/figlet.c index 5d02ad51fd..4232a91a72 100644 --- a/xen/tools/figlet/figlet.c +++ b/xen/tools/figlet/figlet.c @@ -1488,7 +1488,16 @@ static void myputchar(unsigned char c) putc(c, stderr); - if ( nr_chars == 0 ) + if ( nr_chars == 18 ) + { + nr_chars = 0; + putchar('"'); + putchar(' '); + putchar('\\'); + putchar('\n'); + } + + if ( nr_chars++ == 0 ) putchar('"'); putchar('\\'); @@ -1498,15 +1507,6 @@ static void myputchar(unsigned char c) if ( c == '\n' ) startline = 1; - - if ( ++nr_chars == 18 ) - { - nr_chars = 0; - putchar('"'); - putchar(' '); - putchar('\\'); - putchar('\n'); - } } void putstring(string) -- cgit v1.2.3