tuc: fix reading utf-8 characters with more than three bytes - neatvi - [fork] simple vi-type editor with UTF-8 support
 (HTM) git clone git://src.adamsgaard.dk/neatvi
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
 (DIR) commit a2fe7e9ef29a43cf747296180156b2970b309a53
 (DIR) parent 9cc9b8bb918f8a581ed57c730a42d4fe85b3152c
 (HTM) Author: Ali Gholami Rudi <ali@rudi.ir>
       Date:   Sun, 22 May 2016 12:37:00 +0430
       
       uc: fix reading utf-8 characters with more than three bytes
       
       Reported by Gianni Chiappetta <gianni@runlevel6.org>.
       
       Diffstat:
         M uc.c                                |       6 +++---
       
       1 file changed, 3 insertions(+), 3 deletions(-)
       ---
 (DIR) 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;
        }