From: Keir Fraser Date: Wed, 23 Apr 2008 08:02:15 +0000 (+0100) Subject: figlet: Fix handling of full final line of octal output. X-Git-Tag: 3.3.0-rc1~240^2~17 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1fd55df7f9f16a701d9e184f5554ea6c0507a381;p=xen.git figlet: Fix handling of full final line of octal output. It should not be terminated with a backslash. Signed-off-by: Keir Fraser --- 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)