diff options
author | Matthias Eble <psychotrahe@users.sourceforge.net> | 2007-12-10 00:19:27 +0000 |
---|---|---|
committer | Matthias Eble <psychotrahe@users.sourceforge.net> | 2007-12-10 00:19:27 +0000 |
commit | 3bb4b6b336b383c8f1686476cfb96ec674255683 (patch) | |
tree | d71cadec9e5e23765b8ae8ff1f31e3584766c460 /plugins/check_load.c | |
parent | 249bed27d5e064624d3590c98c15aa5401214ffa (diff) | |
download | monitoring-plugins-3bb4b6b336b383c8f1686476cfb96ec674255683.tar.gz |
Fixed check_load argument handling when passing non triplet thresholds. Thanks to Jonathan Kamens (bug #1831890)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1851 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_load.c')
-rw-r--r-- | plugins/check_load.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/check_load.c b/plugins/check_load.c index 9de8ff78..5503204a 100644 --- a/plugins/check_load.c +++ b/plugins/check_load.c @@ -77,6 +77,7 @@ static void get_threshold(char *arg, double *th) { size_t i, n; + int valid = 0; char *str = arg, *p; n = strlen(arg); @@ -84,12 +85,13 @@ get_threshold(char *arg, double *th) th[i] = strtod(str, &p); if(p == str) break; + valid = 1; str = p + 1; if(n <= (size_t)(str - arg)) break; } /* empty argument or non-floatish, so warn about it and die */ - if(!i) usage (_("Warning threshold must be float or float triplet!\n")); + if(!i && !valid) usage (_("Warning threshold must be float or float triplet!\n")); if(i != 2) { /* one or more numbers were given, so fill array with last |