diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-05-23 20:12:47 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-05-23 20:12:47 +0000 |
commit | 7fac308569426c528fea9fdd3201120341f1f49d (patch) | |
tree | ae52128fbdfa00cd201048cbdde1837dfd450af8 /Gui | |
parent | 4499002cf9122ced80b8c3a74970305640e255ac (diff) |
Print error when skin file is not readable (e.g. a directory) instead of hanging
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15555 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui')
-rw-r--r-- | Gui/skin/skin.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Gui/skin/skin.c b/Gui/skin/skin.c index 3b619ed1a3..cf25a2827f 100644 --- a/Gui/skin/skin.c +++ b/Gui/skin/skin.c @@ -688,7 +688,11 @@ int skinRead( char * dname ) linenumber=0; while ( !feof( skinFile ) ) { - fgets( tmp,255,skinFile ); linenumber++; + if (!fgets( tmp,255,skinFile )) { + mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_SKIN_SkinFileNotReadable, fn); + return -1; + } + linenumber++; c=tmp[ strlen( tmp ) - 1 ]; if ( c == '\n' || c == '\r' ) tmp[ strlen( tmp ) - 1 ]=0; c=tmp[ strlen( tmp ) - 1 ]; if ( c == '\n' || c == '\r' ) tmp[ strlen( tmp ) - 1 ]=0; |