Mercurial > mplayer.hg
changeset 32850:48583fc18d1a
Make setname() directly return the string created instead of writing it
into some variable.
(The variable isn't used anywhere else, so it's easier to read this way.)
author | ib |
---|---|
date | Sat, 19 Feb 2011 22:39:17 +0000 |
parents | d99d27c3e82c |
children | 4a0455472d13 |
files | gui/skin/skin.c |
diffstat | 1 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/skin/skin.c Sat Feb 19 22:26:10 2011 +0000 +++ b/gui/skin/skin.c Sat Feb 19 22:39:17 2011 +0000 @@ -39,7 +39,7 @@ static int linenumber; -static unsigned char path[512],fn[512]; +static unsigned char path[512]; static listItems * defList = NULL; static unsigned char window_name[32] = ""; @@ -656,26 +656,31 @@ FILE * skinFile; -static void setname( char * item1, char * item2 ) +static char *setname( char * item1, char * item2 ) { + static char fn[512]; + av_strlcpy(fn, item1, sizeof( fn )); av_strlcat(fn, "/", sizeof( fn )); av_strlcat(fn, item2, sizeof( fn )); av_strlcpy(path, fn, sizeof( path )); av_strlcat(path, "/", sizeof( path )); av_strlcat(fn, "/skin", sizeof( fn )); + + return fn; } int skinRead( char * dname ) { + char * fn; unsigned char tmp[256]; unsigned char * ptmp; unsigned char command[32]; unsigned char param[256]; int i; - setname( skinDirInHome,dname ); + fn = setname( skinDirInHome,dname ); if ( ( skinFile = fopen( fn,"rt" ) ) == NULL ) { - setname( skinMPlayerDir,dname ); + fn = setname( skinMPlayerDir,dname ); if ( ( skinFile = fopen( fn,"rt" ) ) == NULL ) { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_SKIN_SkinFileNotFound,fn );