Index: m_option.c =================================================================== RCS file: /cvsroot/mplayer/main/m_option.c,v retrieving revision 1.6 diff -u -u -r1.6 m_option.c --- m_option.c 30 Jan 2003 21:28:01 -0000 1.6 +++ m_option.c 2 Feb 2003 10:21:41 -0000 @@ -109,9 +109,10 @@ char *endptr; src = 0; - if (param == NULL) + if (param == NULL) { + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %s option must have an integer parameter\n",name); return M_OPT_MISSING_PARAM; - + } tmp_int = strtol(param, &endptr, 0); if (*endptr) { mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %s option must be an integer: %s\n",name, param); @@ -161,8 +162,10 @@ char* endptr; src = 0; - if (param == NULL) + if (param == NULL) { + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %s option must have a float parameter\n",name); return M_OPT_MISSING_PARAM; + } tmp_float = strtod(param, &endptr); @@ -231,8 +234,11 @@ off_t tmp_off; char dummy; - if (param == NULL) + if (param == NULL) { + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %s option must have an integer parameter\n",name); return M_OPT_MISSING_PARAM; + } + if (sscanf(param, sizeof(off_t) == sizeof(int) ? "%d%c" : "%lld%c", &tmp_off, &dummy) != 1) { mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %s option must be an integer: %s\n",opt->name,param); @@ -290,8 +296,10 @@ static int parse_str(m_option_t* opt,char *name, char *param, void* dst, int src) { - if (param == NULL) + if (param == NULL) { + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %s option must have a string parameter\n",name); return M_OPT_MISSING_PARAM; + } if ((opt->flags & M_OPT_MIN) && (strlen(param) < opt->min)) { mp_msg(MSGT_CFGPARSER, MSGL_ERR, "parameter must be >= %d chars: %s\n", @@ -476,8 +484,10 @@ } // All other op need a param - if (param == NULL || strlen(param) == 0) + if (param == NULL || strlen(param) == 0) { + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %s option must have a string parameter\n",name); return M_OPT_MISSING_PARAM; + } while(ptr[0] != '\0') { @@ -815,8 +825,10 @@ char *p; char** lst = NULL; - if (param == NULL || strlen(param) == 0) + if (param == NULL || strlen(param) == 0) { + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %s option must have parameter(s)\n",name); return M_OPT_MISSING_PARAM; + } subparam = malloc(strlen(param)+1); subopt = malloc(strlen(param)+1); @@ -881,8 +893,10 @@ static int parse_imgfmt(m_option_t* opt,char *name, char *param, void* dst, int src) { uint32_t fmt = 0; - if (param == NULL || strlen(param) == 0) + if (param == NULL || strlen(param) == 0) { + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %s option must have a format parameter\n",name); return M_OPT_MISSING_PARAM; + } // From vf_format if(!strcasecmp(param,"444p")) fmt=IMGFMT_444P; else @@ -1003,8 +1017,10 @@ char *s = param,*e = NULL; int r = M_OPT_INVALID; - if(param == NULL) + if(param == NULL) { + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %s option must have a parameter\n",name); return M_OPT_MISSING_PARAM; + } e = strchr(param,'-'); if(e) {