Do not use strnlen any more.
authorPeng Huang <shawn.p.huang@gmail.com>
Sun, 11 Apr 2010 22:38:55 +0000 (06:38 +0800)
committerPeng Huang <shawn.p.huang@gmail.com>
Sun, 11 Apr 2010 22:38:55 +0000 (06:38 +0800)
src/PinyinParser.cc

index ee59047..a28cb32 100644 (file)
@@ -59,8 +59,8 @@ is_pinyin (const gchar *p,
         return NULL;
     }
 
-    len = strnlen (p, 6);
-    len = MIN (len, end - p);
+    /* len < 0 */
+    len = MIN (6, end - p);
     strncpy (buf, p, len);
 
     for (; len > 0; len --) {