OSDN Git Service

10l: fix av_str[i]start()
authorMåns Rullgård <mans@mansr.com>
Tue, 10 Jul 2007 21:43:35 +0000 (21:43 +0000)
committerMåns Rullgård <mans@mansr.com>
Tue, 10 Jul 2007 21:43:35 +0000 (21:43 +0000)
Originally committed as revision 9585 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavutil/string.c

index 20f89c7..2f4de8e 100644 (file)
 
 int av_strstart(const char *str, const char *pfx, const char **ptr)
 {
-    while (*pfx && *pfx++ == *str++);
+    while (*pfx && *pfx == *str) {
+        pfx++;
+        str++;
+    }
     if (!*pfx && ptr)
         *ptr = str;
     return !*pfx;
@@ -33,7 +36,10 @@ int av_strstart(const char *str, const char *pfx, const char **ptr)
 
 int av_stristart(const char *str, const char *pfx, const char **ptr)
 {
-    while (*pfx && toupper((unsigned)*pfx++) == toupper((unsigned)*str++));
+    while (*pfx && toupper((unsigned)*pfx) == toupper((unsigned)*str)) {
+        pfx++;
+        str++;
+    }
     if (!*pfx && ptr)
         *ptr = str;
     return !*pfx;