-
-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
Signed-off-by: Arnaud Quette <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
#include "sstate.h" | ||
#include "user.h" | ||
#include "netssl.h" | ||
#include <ctype.h> | ||
|
||
ups_t *upstable = NULL; | ||
int num_ups = 0; | ||
|
@@ -121,20 +122,38 @@ static int parse_upsd_conf_args(int numargs, char **arg) | |
|
||
/* MAXAGE <seconds> */ | ||
if (!strcmp(arg[0], "MAXAGE")) { | ||
maxage = atoi(arg[1]); | ||
return 1; | ||
if (isdigit(arg[1])) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
zykh
Contributor
|
||
maxage = atoi(arg[1]); | ||
return 1; | ||
} | ||
else { | ||
upslogx(LOG_ERR, "MAXAGE has non numeric value (%s)!", arg[1]); | ||
return 0; | ||
} | ||
} | ||
|
||
/* TRACKINGDELAY <seconds> */ | ||
if (!strcmp(arg[0], "TRACKINGDELAY")) { | ||
tracking_delay = atoi(arg[1]); | ||
return 1; | ||
if (isdigit(arg[1])) { | ||
tracking_delay = atoi(arg[1]); | ||
return 1; | ||
} | ||
else { | ||
upslogx(LOG_ERR, "TRACKINGDELAY has non numeric value (%s)!", arg[1]); | ||
return 0; | ||
} | ||
} | ||
|
||
/* MAXCONN <connections> */ | ||
if (!strcmp(arg[0], "MAXCONN")) { | ||
maxconn = atoi(arg[1]); | ||
return 1; | ||
if (isdigit(arg[1])) { | ||
maxconn = atoi(arg[1]); | ||
return 1; | ||
} | ||
else { | ||
upslogx(LOG_ERR, "MAXCONN has non numeric value (%s)!", arg[1]); | ||
return 0; | ||
} | ||
} | ||
|
||
/* STATEPATH <dir> */ | ||
|
@@ -168,8 +187,14 @@ static int parse_upsd_conf_args(int numargs, char **arg) | |
#ifdef WITH_CLIENT_CERTIFICATE_VALIDATION | ||
/* CERTREQUEST (0 | 1 | 2) */ | ||
if (!strcmp(arg[0], "CERTREQUEST")) { | ||
certrequest = atoi(arg[1]); | ||
return 1; | ||
if (isdigit(arg[1])) { | ||
certrequest = atoi(arg[1]); | ||
return 1; | ||
} | ||
else { | ||
upslogx(LOG_ERR, "CERTREQUEST has non numeric value (%s)!", arg[1]); | ||
return 0; | ||
} | ||
} | ||
#endif /* WITH_CLIENT_CERTIFICATE_VALIDATION */ | ||
#endif /* WITH_OPENSSL | WITH_NSS */ | ||
|
@aquette
isdigit()
takes achar
/int
rather than achar *
. search forserver/conf.c
in http://buildbot.networkupstools.org/public/nut/builders/FreeBSD-x64/builds/593/steps/compile/logs/stdio