[vlc-devel] commit: asprintf -> strdup ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Jan 3 15:57:12 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jan  3 16:56:58 2010 +0200| [12bd062b6076cd76509664feb580611c1791bc8b] | committer: Rémi Denis-Courmont 

asprintf -> strdup

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

 extras/analyser/zsh.cpp           |    2 +-
 modules/demux/playlist/playlist.c |    3 ++-
 modules/misc/notify/growl.m       |    6 +++++-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/extras/analyser/zsh.cpp b/extras/analyser/zsh.cpp
index 4f432fa..e5b10fa 100644
--- a/extras/analyser/zsh.cpp
+++ b/extras/analyser/zsh.cpp
@@ -257,7 +257,7 @@ void ParseOption( module_config_t *p_item, mumap &mods, mcmap &mods2 )
             list = list.append( "'" );
             ++range.first;
         }
-        asprintf( &psz_arguments, "%s", list.c_str() );
+        psz_arguments = strdup( list.c_str() );
     }
     break;
 
diff --git a/modules/demux/playlist/playlist.c b/modules/demux/playlist/playlist.c
index c02c186..f6ea892 100644
--- a/modules/demux/playlist/playlist.c
+++ b/modules/demux/playlist/playlist.c
@@ -192,7 +192,8 @@ char *FindPrefix( demux_t *p_demux )
     }
     else
     {
-        if( asprintf( &psz_path,"%s", p_demux->psz_path ) == -1 )
+        psz_path = strdup( p_demux->psz_path );
+        if( psz_path == NULL )
             return NULL;
     }
 
diff --git a/modules/misc/notify/growl.m b/modules/misc/notify/growl.m
index 575739f..319c7eb 100644
--- a/modules/misc/notify/growl.m
+++ b/modules/misc/notify/growl.m
@@ -198,7 +198,11 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
     else if( psz_artist )
         i_ret = asprintf( &psz_tmp, "%s\n%s", psz_title, psz_artist );
     else
-        i_ret = asprintf( &psz_tmp, "%s", psz_title );
+    {
+        psz_tmp = strdup( psz_title );
+        if( psz_tmp == NULL )
+           i_ret = -1;
+    }
 
     if( i_ret == -1 )
     {




More information about the vlc-devel mailing list