mirror of https://github.com/mpv-player/mpv
1000l! crashing on broken config files finally fixed!
Patch by Alex Sisson (alex_sisson at yahoo.co.uk): a missing parameter on mp_msg meant it crashed instead of printing a nice message if you put entries in the config with no parameter. also did a few english-tidies on error messages in there. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10246 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
0473f386a4
commit
3e4aa8b0bd
|
@ -121,7 +121,7 @@ int m_config_parse_config_file(m_config_t* config, char *conffile)
|
|||
/* check '=' */
|
||||
if (line[line_pos++] != '=') {
|
||||
PRINT_LINENUM;
|
||||
mp_msg(MSGT_CFGPARSER,MSGL_ERR,"Option %s need a parameter at line %d\n",line_num);
|
||||
mp_msg(MSGT_CFGPARSER,MSGL_ERR,"Option %s needs a parameter at line %d\n",opt,line_num);
|
||||
ret = -1;
|
||||
errors++;
|
||||
continue;
|
||||
|
@ -139,7 +139,7 @@ int m_config_parse_config_file(m_config_t* config, char *conffile)
|
|||
param[param_pos++] = line[line_pos++];
|
||||
if (param_pos >= MAX_PARAM_LEN) {
|
||||
PRINT_LINENUM;
|
||||
mp_msg(MSGT_CFGPARSER,MSGL_ERR,"Option %s have a too long parameter at line %d\n",opt,line_num);
|
||||
mp_msg(MSGT_CFGPARSER,MSGL_ERR,"Option %s has a too long parameter at line %d\n",opt,line_num);
|
||||
ret = -1;
|
||||
errors++;
|
||||
goto nextline;
|
||||
|
@ -164,7 +164,7 @@ int m_config_parse_config_file(m_config_t* config, char *conffile)
|
|||
/* did we read a parameter? */
|
||||
if (param_pos == 0) {
|
||||
PRINT_LINENUM;
|
||||
mp_msg(MSGT_CFGPARSER,MSGL_ERR,"Option %s need a parameter at line %d\n",opt,line_num);
|
||||
mp_msg(MSGT_CFGPARSER,MSGL_ERR,"Option %s needs a parameter at line %d\n",opt,line_num);
|
||||
ret = -1;
|
||||
errors++;
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue