Code

utf8: make utf8_to_unicode return 0 when encountering invalid symbols
authorJonas Fonseca <fonseca@diku.dk>
Tue, 30 Mar 2010 11:00:35 +0000 (07:00 -0400)
committerJonas Fonseca <fonseca@diku.dk>
Tue, 30 Mar 2010 11:04:57 +0000 (07:04 -0400)
... instead of calling die.

tig.c

diff --git a/tig.c b/tig.c
index cad66c8e6e20d85fe8f84eb262e007c7e2112dc7..d4a559180315a33dbb9835dee50682b8273bb002 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -6842,7 +6842,7 @@ utf8_to_unicode(const char *string, size_t length)
                unicode +=  (string[5] & 0x3f);
                break;
        default:
-               die("Invalid Unicode length");
+               return 0;
        }
 
        /* Invalid characters could return the special 0xfffd value but NUL