[vlc-devel] commit: Make sure that var_Get on a string will return a non NULL value. ( Laurent Aimar )
git version control
git at videolan.org
Tue Mar 17 20:08:47 CET 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Mar 16 21:09:44 2009 +0100| [d463e6950ca53a32aa6ff5b2ed79ca2d976cf6c4] | committer: Laurent Aimar
Make sure that var_Get on a string will return a non NULL value.
The current code assume it everywhere.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d463e6950ca53a32aa6ff5b2ed79ca2d976cf6c4
---
src/misc/variables.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/misc/variables.c b/src/misc/variables.c
index be81856..80cafff 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -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 )
{
More information about the vlc-devel
mailing list