[vlc-devel] commit: factorize. ( Rémi Duraffort )

git version control git at videolan.org
Mon Dec 28 14:44:31 CET 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Dec 28 14:39:33 2009 +0100| [bb8a0acca9cc31fb2c614cefb1c320ba08215eef] | committer: Rémi Duraffort 

factorize.

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

 src/input/es_out.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index a7ef525..7d358ac 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -927,10 +927,9 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id,
     {
         if( psz_language && *psz_language )
         {
-            text.psz_string = malloc( strlen( fmt->psz_description) +
-                                      strlen( psz_language ) + 10 );
-            sprintf( text.psz_string, "%s - [%s]", fmt->psz_description,
-                                                   psz_language );
+            if( asprintf( &text.psz_string, "%s - [%s]", fmt->psz_description,
+                          psz_language ) == -1 )
+                text.psz_string = NULL;
         }
         else text.psz_string = strdup( fmt->psz_description );
     }




More information about the vlc-devel mailing list