From 3f1ac2596ccd7aa12e1244e48b5e37a932bbe734 Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Mon, 9 Feb 2015 13:31:39 +0800 Subject: [PATCH] Fix getccol reporting when dealing with characters in range 0x80 .. 0xA0. --- random.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/random.c b/random.c index 7aa2e9a..a108851 100644 --- a/random.c +++ b/random.c @@ -173,13 +173,13 @@ int getccol(int bflg) unicode_t c; i += utf8_to_unicode(dlp->l_text, i, len, &c); - if (c != ' ' && c != '\t' && bflg) + if( bflg && c != ' ' && c != '\t') /* Request Stop at first non-blank */ break; if (c == '\t') col |= tabmask; - else if (c < 0x20 || c == 0x7F) + else if (c < 0x20 || c == 0x7F) /* displayed as ^c */ ++col; - else if (c >= 0xc0 && c <= 0xa0) + else if (c >= 0x80 && c <= 0xa0) /* displayed as \xx */ col += 2; ++col; }