[experimental-ims] 9f5becc FlexeLinting
Geoff Simmons
geoff at varnish-cache.org
Tue Jan 10 00:03:27 CET 2012
commit 9f5becc0c3d1a409d9e3ac753762cd6ce7149e25
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Thu Dec 15 09:00:49 2011 +0000
FlexeLinting
diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index fedc0d1..6faf0c5 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -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,12 +241,13 @@ 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 (*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);
More information about the varnish-commit
mailing list