Commit 14c846fc authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Dridi Boukelmoune

Test strtoul() result comprehensively.

parent 5711cd1e
......@@ -343,6 +343,7 @@ main(int argc, char **argv)
{
int o, once = 0;
pthread_t thr;
char *e = NULL;
vut = VUT_InitProg(argc, argv, &vopt_spec);
AN(vut);
......@@ -361,8 +362,9 @@ main(int argc, char **argv)
usage(0);
case 'p':
errno = 0;
period = strtol(optarg, NULL, 0);
if (errno != 0) {
e = NULL;
period = strtoul(optarg, &e, 0);
if (errno != 0 || e == NULL || *e != '\0') {
fprintf(stderr,
"Syntax error, %s is not a number", optarg);
exit(1);
......
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