[vlc-devel] commit: Don't reinvent strcasecmp(). (Antoine Cellerier )

git version control git at videolan.org
Mon Apr 6 23:28:53 CEST 2009


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Mon Apr  6 23:29:57 2009 +0200| [8e305e1b58fc57d8d25869eb60eab804143e52e5] | committer: Antoine Cellerier 

Don't reinvent strcasecmp().

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8e305e1b58fc57d8d25869eb60eab804143e52e5
---

 src/misc/image.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/misc/image.c b/src/misc/image.c
index 86eeb45..b0a808f 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -549,15 +549,8 @@ vlc_fourcc_t image_Type2Fourcc( const char *psz_type )
     int i;
 
     for( i = 0; ext_table[i].i_codec; i++ )
-    {
-        int j;
-        for( j = 0; toupper(ext_table[i].psz_ext[j]) == toupper(psz_type[j]);
-             j++ )
-        {
-            if( !ext_table[i].psz_ext[j] && !psz_type[j] )
-                return ext_table[i].i_codec;
-        }
-    }
+        if( !strcasecmp( ext_table[i].psz_ext, psz_type ) )
+            return ext_table[i].i_codec;
 
     return 0;
 }




More information about the vlc-devel mailing list