tuc: fix reading utf-8 characters with more than three bytes - neatvi - [fork] … | |
git clone git://src.adamsgaard.dk/neatvi | |
Log | |
Files | |
Refs | |
README | |
--- | |
commit a2fe7e9ef29a43cf747296180156b2970b309a53 | |
parent 9cc9b8bb918f8a581ed57c730a42d4fe85b3152c | |
Author: Ali Gholami Rudi <[email protected]> | |
Date: Sun, 22 May 2016 12:37:00 +0430 | |
uc: fix reading utf-8 characters with more than three bytes | |
Reported by Gianni Chiappetta <[email protected]>. | |
Diffstat: | |
M uc.c | 6 +++--- | |
1 file changed, 3 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/uc.c b/uc.c | |
t@@ -16,11 +16,11 @@ int uc_len(char *s) | |
return 2; | |
if (~c & 0x10) | |
return 3; | |
- if (~c & 0x80) | |
+ if (~c & 0x08) | |
return 4; | |
- if (~c & 0x40) | |
+ if (~c & 0x04) | |
return 5; | |
- if (~c & 0x20) | |
+ if (~c & 0x02) | |
return 6; | |
return 1; | |
} |