diff string.c @ 360:92b31fec32b0 libavutil

10l: fix av_str[i]start()
author mru
date Tue, 10 Jul 2007 21:43:35 +0000
parents 2fb35d82b0bd
children 2cd0add8ac0c
line wrap: on
line diff
--- a/string.c	Sun Jul 08 15:56:31 2007 +0000
+++ b/string.c	Tue Jul 10 21:43:35 2007 +0000
@@ -25,7 +25,10 @@
 
 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_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;