diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-04-23 09:02:15 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-04-23 09:02:15 +0100 |
commit | 1fd55df7f9f16a701d9e184f5554ea6c0507a381 (patch) | |
tree | 6819a25208247dee35af2346b614c429c876287e /xen/tools | |
parent | d97223cd7759bf309a17bf6f8e8ef4dd1ba71f89 (diff) | |
download | xen-1fd55df7f9f16a701d9e184f5554ea6c0507a381.tar.gz xen-1fd55df7f9f16a701d9e184f5554ea6c0507a381.tar.bz2 xen-1fd55df7f9f16a701d9e184f5554ea6c0507a381.zip |
figlet: Fix handling of full final line of octal output.
It should not be terminated with a backslash.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/tools')
-rw-r--r-- | xen/tools/figlet/figlet.c | 20 |
1 files changed, 10 insertions, 10 deletions
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) |