diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2023-11-01 11:05:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-01 11:05:50 +0100 |
commit | 6d08e1c8c96d0327a5b819dc1fbb0d5754f3e2e5 (patch) | |
tree | 575867b1d1eef4cd20215f22f9151ebb4a02c93d /plugins/negate.c | |
parent | 03bde80abbda6fba2225568c3285a2ff2b5445a8 (diff) | |
parent | 76d9f25cd0dbe99657baeb6fa139a1831558adae (diff) | |
download | monitoring-plugins-6d08e1c.tar.gz |
Merge branch 'master' into fix_check_mailq
Diffstat (limited to 'plugins/negate.c')
-rw-r--r-- | plugins/negate.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/negate.c b/plugins/negate.c index 79cca7e0..745c12ac 100644 --- a/plugins/negate.c +++ b/plugins/negate.c | |||
@@ -63,7 +63,6 @@ main (int argc, char **argv) | |||
63 | char *sub; | 63 | char *sub; |
64 | char **command_line; | 64 | char **command_line; |
65 | output chld_out, chld_err; | 65 | output chld_out, chld_err; |
66 | int i; | ||
67 | 66 | ||
68 | setlocale (LC_ALL, ""); | 67 | setlocale (LC_ALL, ""); |
69 | bindtextdomain (PACKAGE, LOCALEDIR); | 68 | bindtextdomain (PACKAGE, LOCALEDIR); |
@@ -86,7 +85,7 @@ main (int argc, char **argv) | |||
86 | result = cmd_run_array (command_line, &chld_out, &chld_err, 0); | 85 | result = cmd_run_array (command_line, &chld_out, &chld_err, 0); |
87 | } | 86 | } |
88 | if (chld_err.lines > 0) { | 87 | if (chld_err.lines > 0) { |
89 | for (i = 0; i < chld_err.lines; i++) { | 88 | for (size_t i = 0; i < chld_err.lines; i++) { |
90 | fprintf (stderr, "%s\n", chld_err.line[i]); | 89 | fprintf (stderr, "%s\n", chld_err.line[i]); |
91 | } | 90 | } |
92 | } | 91 | } |
@@ -95,7 +94,7 @@ main (int argc, char **argv) | |||
95 | if (chld_out.lines == 0) | 94 | if (chld_out.lines == 0) |
96 | die (max_state_alt (result, STATE_UNKNOWN), _("No data returned from command\n")); | 95 | die (max_state_alt (result, STATE_UNKNOWN), _("No data returned from command\n")); |
97 | 96 | ||
98 | for (i = 0; i < chld_out.lines; i++) { | 97 | for (size_t i = 0; i < chld_out.lines; i++) { |
99 | if (subst_text && result >= 0 && result <= 4 && result != state[result]) { | 98 | if (subst_text && result >= 0 && result <= 4 && result != state[result]) { |
100 | /* Loop over each match found */ | 99 | /* Loop over each match found */ |
101 | while ((sub = strstr (chld_out.line[i], state_text (result)))) { | 100 | while ((sub = strstr (chld_out.line[i], state_text (result)))) { |