diff options
author | Greg Cox <gcox@fibbsbozza.local> | 2014-07-29 22:52:12 (GMT) |
---|---|---|
committer | Greg Cox <gcox@fibbsbozza.local> | 2014-07-29 22:52:12 (GMT) |
commit | 4273dd06ff3e52094d6b267d00e8c51dd74de364 (patch) | |
tree | 425d127da5dbec7013999ed01b469fc3f72992d9 /plugins/negate.c | |
parent | f05e7016320f4671fbf86cc5abc277efea20f79e (diff) | |
parent | 6f3d5825b203b75aef8d68bf0d117e7a1a4c0616 (diff) | |
download | monitoring-plugins-4273dd06ff3e52094d6b267d00e8c51dd74de364.tar.gz |
Merge remote-tracking branch 'upstream/master'refs/pull/1257/head
Conflicts:
plugins/netutils.c
Diffstat (limited to 'plugins/negate.c')
-rw-r--r-- | plugins/negate.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/plugins/negate.c b/plugins/negate.c index 4bd09de..beaed1e 100644 --- a/plugins/negate.c +++ b/plugins/negate.c | |||
@@ -35,16 +35,16 @@ const char *email = "devel@monitoring-plugins.org"; | |||
35 | 35 | ||
36 | #define DEFAULT_TIMEOUT 11 | 36 | #define DEFAULT_TIMEOUT 11 |
37 | 37 | ||
38 | #include <ctype.h> | ||
39 | |||
40 | #include "common.h" | 38 | #include "common.h" |
41 | #include "utils.h" | 39 | #include "utils.h" |
42 | #include "utils_cmd.h" | 40 | #include "utils_cmd.h" |
43 | 41 | ||
42 | #include <ctype.h> | ||
43 | |||
44 | /* char *command_line; */ | 44 | /* char *command_line; */ |
45 | 45 | ||
46 | static const char **process_arguments (int, char **); | 46 | static const char **process_arguments (int, char **); |
47 | int validate_arguments (char **); | 47 | void validate_arguments (char **); |
48 | void print_help (void); | 48 | void print_help (void); |
49 | void print_usage (void); | 49 | void print_usage (void); |
50 | int subst_text = FALSE; | 50 | int subst_text = FALSE; |
@@ -98,8 +98,7 @@ main (int argc, char **argv) | |||
98 | die (max_state_alt (result, STATE_UNKNOWN), _("No data returned from command\n")); | 98 | die (max_state_alt (result, STATE_UNKNOWN), _("No data returned from command\n")); |
99 | 99 | ||
100 | for (i = 0; i < chld_out.lines; i++) { | 100 | for (i = 0; i < chld_out.lines; i++) { |
101 | if (subst_text && result != state[result] && | 101 | if (subst_text && result >= 0 && result <= 4 && result != state[result]) { |
102 | result >= 0 && result <= 4) { | ||
103 | /* Loop over each match found */ | 102 | /* Loop over each match found */ |
104 | while ((sub = strstr (chld_out.line[i], state_text (result)))) { | 103 | while ((sub = strstr (chld_out.line[i], state_text (result)))) { |
105 | /* Terminate the first part and skip over the string we'll substitute */ | 104 | /* Terminate the first part and skip over the string we'll substitute */ |
@@ -206,7 +205,7 @@ process_arguments (int argc, char **argv) | |||
206 | } | 205 | } |
207 | 206 | ||
208 | 207 | ||
209 | int | 208 | void |
210 | validate_arguments (char **command_line) | 209 | validate_arguments (char **command_line) |
211 | { | 210 | { |
212 | if (command_line[0] == NULL) | 211 | if (command_line[0] == NULL) |