]> git.sesse.net Git - vlc/commitdiff
Fix a few warnings
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 12 Nov 2006 15:33:59 +0000 (15:33 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 12 Nov 2006 15:33:59 +0000 (15:33 +0000)
include/vlc_demux.h
modules/demux/playlist/dvb.c

index 1d8c77dbfb3c1204c0b73d7457e6685bb40c7325..2ebaa4e655abf7c713ebd0429dbc50e9c6133bb9 100644 (file)
@@ -137,15 +137,15 @@ static inline int demux2_Control( demux_t *p_demux, int i_query, ... )
  * Miscellaneous helpers for demuxers
  *************************************************************************/
 
-static inline vlc_bool_t isExtension( demux_t *p_demux, char *psz_requested )
+static inline vlc_bool_t isExtension( demux_t *p_demux, const char *psz_requested )
 {
-    char    *psz_ext;
-    psz_ext = strrchr ( p_demux->psz_path, '.' );
+    const char *psz_ext = strrchr ( p_demux->psz_path, '.' );
     if( !psz_ext || strcmp( psz_ext, psz_requested ) )
         return VLC_FALSE;
     return VLC_TRUE;
 }
-static inline vlc_bool_t isDemux( demux_t *p_demux, char *psz_requested )
+
+static inline vlc_bool_t isDemux( demux_t *p_demux, const char *psz_requested )
 {
    if( !p_demux->psz_demux || strcmp( p_demux->psz_demux, psz_requested ) )
         return VLC_FALSE;
index 91662f32dc359bfce8fd892f8c7190d8c4fb896d..1af284c58073ab948475786ff0d649d297f4e404 100644 (file)
@@ -133,8 +133,8 @@ static int Demux( demux_t *p_demux )
 
 static struct
 {
-    char *psz_name;
-    char *psz_option;
+    const char *psz_name;
+    const char *psz_option;
 
 } dvb_options[] =
 {
@@ -204,7 +204,7 @@ static int ParseLine( char *psz_line, char **ppsz_name,
 
     while( psz_parse )
     {
-        char *psz_option = 0;
+        const char *psz_option = 0;
         char *psz_end = strchr( psz_parse, ':' );
         if( psz_end ) { *psz_end = 0; psz_end++; }
 
@@ -260,9 +260,10 @@ static int ParseLine( char *psz_line, char **ppsz_name,
 
         if( psz_option && pppsz_options && pi_options )
         {
-            psz_option = strdup( psz_option );
-            INSERT_ELEM( *pppsz_options, (*pi_options), (*pi_options),
-                         psz_option );
+            char *psz_dup = strdup( psz_option );
+            if (psz_dup != NULL)
+                INSERT_ELEM( *pppsz_options, (*pi_options), (*pi_options),
+                             psz_dup );
         }
 
         psz_parse = psz_end;