Commit 708ed766 authored by Jean-Paul Saman's avatar Jean-Paul Saman

dvbinfo: check optarg

parent 9ee8155e
...@@ -609,6 +609,8 @@ int main(int argc, char **pp_argv) ...@@ -609,6 +609,8 @@ int main(int argc, char **pp_argv)
/* - tuning options - */ /* - tuning options - */
case 'c': case 'c':
if (optarg)
{
param->threshold = strtoul(optarg, NULL, 10); param->threshold = strtoul(optarg, NULL, 10);
if (((errno == ERANGE) && (param->threshold == ULONG_MAX)) || if (((errno == ERANGE) && (param->threshold == ULONG_MAX)) ||
((errno != 0) && (param->threshold == 0))) ((errno != 0) && (param->threshold == 0)))
...@@ -617,6 +619,7 @@ int main(int argc, char **pp_argv) ...@@ -617,6 +619,7 @@ int main(int argc, char **pp_argv)
params_free(param); params_free(param);
usage(); usage();
} }
}
break; break;
/* - Statistics */ /* - Statistics */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment