]> git.sesse.net Git - vlc/commitdiff
factorize.
authorRémi Duraffort <ivoire@videolan.org>
Mon, 28 Dec 2009 13:39:33 +0000 (14:39 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Mon, 28 Dec 2009 13:39:33 +0000 (14:39 +0100)
src/input/es_out.c

index a7ef5258c6a76533b7adf7d639dbc19ac797674c..7d358ace527a3e06aac998e73dd6699558ddd951 100644 (file)
@@ -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 );
     }