]> git.sesse.net Git - vlc/commitdiff
Make sure that var_Get on a string will return a non NULL value.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 16 Mar 2009 20:09:44 +0000 (21:09 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Tue, 17 Mar 2009 19:06:49 +0000 (20:06 +0100)
The current code assume it everywhere.

src/misc/variables.c

index be8185690de41aa6dcc572fa10227d7e4ab863e8..80caffffe734f6131b4981ff9659aedcfae6a64c 100644 (file)
@@ -68,7 +68,7 @@ static int CmpAddress( vlc_value_t v, vlc_value_t w ) { return v.p_address == w.
  * Local duplication functions, and local deallocation functions
  *****************************************************************************/
 static void DupDummy( vlc_value_t *p_val ) { (void)p_val; /* unused */ }
-static void DupString( vlc_value_t *p_val ) { if( p_val->psz_string ) p_val->psz_string = strdup( p_val->psz_string ); }
+static void DupString( vlc_value_t *p_val ) { p_val->psz_string = strdup( p_val->psz_string ?: ""); }
 
 static void DupList( vlc_value_t *p_val )
 {