OSDN Git Service

Use strcasecmp() instead of re-inventing it.
authorDiego Pettenò <flameeyes@gmail.com>
Mon, 12 May 2008 01:17:00 +0000 (01:17 +0000)
committerBenoit Fouet <benoit.fouet@free.fr>
Mon, 12 May 2008 01:17:00 +0000 (01:17 +0000)
Patch by Diego 'Flameeyes' Pettenò flameeyesATgmailPOINTcom

Originally committed as revision 13132 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/img2.c

index 0523bc7..022c6a2 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "libavutil/avstring.h"
 #include "avformat.h"
+#include <strings.h>
 
 typedef struct {
     int img_first;
@@ -102,11 +103,8 @@ static enum CodecID av_str2id(const IdStrMap *tags, const char *str)
     str++;
 
     while (tags->id) {
-        int i;
-        for(i=0; toupper(tags->str[i]) == toupper(str[i]); i++){
-            if(tags->str[i]==0 && str[i]==0)
-                return tags->id;
-        }
+        if (!strcasecmp(str, tags->str))
+            return tags->id;
 
         tags++;
     }