[vlc-commits] freetype: simplifications.

Rémi Duraffort git at videolan.org
Sun May 1 14:23:34 CEST 2011


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sun May  1 13:40:23 2011 +0200| [2c649fb470d6db3d811700e00382f37bba3d7468] | committer: Rémi Duraffort

freetype: simplifications.

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

 modules/misc/text_renderer/freetype.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/modules/misc/text_renderer/freetype.c b/modules/misc/text_renderer/freetype.c
index 37ed937..7721ab6 100644
--- a/modules/misc/text_renderer/freetype.c
+++ b/modules/misc/text_renderer/freetype.c
@@ -356,14 +356,11 @@ static int Create( vlc_object_t *p_this )
 #ifdef HAVE_STYLES
         psz_fontfamily = strdup( DEFAULT_FAMILY );
 #else
-        psz_fontfamily = (char *)malloc( PATH_MAX + 1 );
-        if( !psz_fontfamily )
-            goto error;
 # ifdef WIN32
-        strcat( psz_fontfamily, p_sys->psz_win_fonts_path );
-        strcat( psz_fontfamily, DEFAULT_FONT );
+        if( asprintf( &psz_fontfamily, "%s%s", p_sys->psz_win_fonts_path, DEFAULT_FONT ) == -1 )
+            goto error;
 # else
-        strcpy( psz_fontfamily, DEFAULT_FONT );
+        psz_fontfamily = strdup( DEFAULT_FONT );
 # endif
         msg_Err( p_filter,"User specified an empty fontfile, using %s", psz_fontfamily );
 #endif



More information about the vlc-commits mailing list