diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-07-05 22:01:07 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-07-05 22:01:07 +0000 |
commit | 4c4a1070febe5a140cac0357267af338b9852a7e (patch) | |
tree | d7ed87a85da0733f33ea47c25797f58c25e5e9fc /gui/skin/font.c | |
parent | b3d59ea908ce87b3dc50bb9ba0ac81edd4765797 (diff) | |
download | mpv-4c4a1070febe5a140cac0357267af338b9852a7e.tar.bz2 mpv-4c4a1070febe5a140cac0357267af338b9852a7e.tar.xz |
Avoid code duplication and ugly config.h hack by using av_strlcat/av_strlcpy
instead of plain strlcat/strlcpy
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23723 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'gui/skin/font.c')
-rw-r--r-- | gui/skin/font.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gui/skin/font.c b/gui/skin/font.c index 3860079a98..90210ced4a 100644 --- a/gui/skin/font.c +++ b/gui/skin/font.c @@ -10,6 +10,7 @@ #include "font.h" #include "cut.h" #include "../mp_msg.h" +#include "../libavutil/avstring.h" int items; @@ -27,7 +28,7 @@ int fntAddNewFont( char * name ) if ( ( Fonts[id]=calloc( 1,sizeof( bmpFont ) ) ) == NULL ) return -1; - strlcpy( Fonts[id]->name,name,128 ); // FIXME: as defined in font.h + av_strlcpy( Fonts[id]->name,name,128 ); // FIXME: as defined in font.h for ( i=0;i<256;i++ ) Fonts[id]->Fnt[i].x=Fonts[id]->Fnt[i].y=Fonts[id]->Fnt[i].sx=Fonts[id]->Fnt[i].sy=-1; @@ -60,8 +61,8 @@ int fntRead( char * path,char * fname ) if ( id < 0 ) return id; - strlcpy( tmp,path,sizeof( tmp ) ); - strlcat( tmp,fname,sizeof( tmp ) ); strlcat( tmp,".fnt",sizeof( tmp ) ); + av_strlcpy( tmp,path,sizeof( tmp ) ); + av_strlcat( tmp,fname,sizeof( tmp ) ); av_strlcat( tmp,".fnt",sizeof( tmp ) ); if ( ( f=fopen( tmp,"rt" ) ) == NULL ) { free( Fonts[id] ); return -3; } @@ -94,7 +95,7 @@ int fntRead( char * path,char * fname ) { if ( !strcmp( command,"image" ) ) { - strlcpy( tmp,path,sizeof( tmp ) ); strlcat( tmp,param,sizeof( tmp ) ); + av_strlcpy( tmp,path,sizeof( tmp ) ); av_strlcat( tmp,param,sizeof( tmp ) ); mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[font] font imagefile: %s\n",tmp ); if ( skinBPRead( tmp,&Fonts[id]->Bitmap ) ) return -4; } |