]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
'<=' fail: '< 0xC2' means invalid '== 0xC2' does not, I had it right in the comment...
authorblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 25 Dec 2009 09:29:35 +0000 (09:29 +0000)
committerblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 25 Dec 2009 09:29:35 +0000 (09:29 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9687 d7cf8633-e32d-0410-b094-e92efae38249

utf8lib.c

index 6b2b985e0e441cb6801bee024f0549368dd4ad13..5f46832a00361bf28c91f99ecf246fc7c0204149 100644 (file)
--- a/utf8lib.c
+++ b/utf8lib.c
@@ -41,7 +41,7 @@ static qboolean u8_analyze(const char *_s, size_t *_start, size_t *_len, Uchar *
 findchar:
 
        // <0xC2 is always an overlong encoding, they're invalid, thus skipped
-       while (i < _maxlen && s[i] && s[i] >= 0x80 && s[i] <= 0xC2) {
+       while (i < _maxlen && s[i] && s[i] >= 0x80 && s[i] < 0xC2) {
                //fprintf(stderr, "skipping\n");
                ++i;
        }
@@ -144,7 +144,7 @@ size_t u8_strlen(const char *_s)
                }
 
                // invalid, skip u8_analyze
-               if (*s <= 0xC2)
+               if (*s < 0xC2)
                {
                        ++s;
                        continue;
@@ -188,7 +188,7 @@ size_t u8_strnlen(const char *_s, size_t n)
                }
 
                // invalid, skip u8_analyze
-               if (*s <= 0xC2)
+               if (*s < 0xC2)
                {
                        ++s;
                        --n;
@@ -233,7 +233,7 @@ size_t u8_bytelen(const char *_s, size_t n)
                }
 
                // invalid, skip u8_analyze
-               if (*s <= 0xC2)
+               if (*s < 0xC2)
                {
                        ++s;
                        ++len;
@@ -312,7 +312,7 @@ int u8_charidx(const char *_s, size_t i, size_t *len)
                }
 
                // invalid, skip u8_analyze
-               if (s[ofs] <= 0xC2)
+               if (s[ofs] < 0xC2)
                {
                        ++ofs;
                        continue;
@@ -373,7 +373,7 @@ size_t u8_prevbyte(const char *_s, size_t i)
                }
 
                // invalid, skip u8_analyze
-               if (s[ofs] <= 0xC2)
+               if (s[ofs] < 0xC2)
                {
                        ++ofs;
                        continue;