[vlc-devel] commit: var_CreateGetString must return NULL in case of error ( Rafaël Carré )

git version control git at videolan.org
Fri May 30 16:51:25 CEST 2008


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Fri May 30 16:52:41 2008 +0200| [6f1a3e531fea1743aff0b39ed4a80dbe35225852]

var_CreateGetString must return NULL in case of error

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

 include/vlc_variables.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/vlc_variables.h b/include/vlc_variables.h
index b553a7c..ecd997e 100644
--- a/include/vlc_variables.h
+++ b/include/vlc_variables.h
@@ -359,10 +359,10 @@ static inline float __var_GetFloat( vlc_object_t *p_obj, const char *psz_name )
 static inline char *__var_GetString( vlc_object_t *p_obj, const char *psz_name )
 {
     vlc_value_t val; val.psz_string = NULL;
-    if( !__var_Get( p_obj, psz_name, &val ) )
-        return val.psz_string;
+    if( __var_Get( p_obj, psz_name, &val ) )
+        return NULL;
     else
-        return strdup( "" );
+        return val.psz_string;
 }
 
 static inline char *__var_GetNonEmptyString( vlc_object_t *obj, const char *name )




More information about the vlc-devel mailing list