Commit 9f5becc0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

FlexeLinting

parent 65d96284
......@@ -161,7 +161,7 @@ tweak_generic_double(struct cli *cli, const struct parspec *par,
if (arg != NULL) {
p = NULL;
u = strtod(arg, &p);
if (arg == '\0' || *p != '\0') {
if (*p != '\0') {
VCLI_Out(cli,
"Not a number (%s)\n", arg);
VCLI_SetResult(cli, CLIS_PARAM);
......@@ -241,13 +241,14 @@ tweak_generic_uint(struct cli *cli, volatile unsigned *dest, const char *arg,
p = NULL;
if (!strcasecmp(arg, "unlimited"))
u = UINT_MAX;
else
else {
u = strtoul(arg, &p, 0);
if (*arg == '\0' || *p != '\0') {
VCLI_Out(cli, "Not a number (%s)\n", arg);
VCLI_SetResult(cli, CLIS_PARAM);
return (-1);
}
}
if (u < min) {
VCLI_Out(cli, "Must be at least %u\n", min);
VCLI_SetResult(cli, CLIS_PARAM);
......
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