diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2023-10-29 11:09:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-29 11:09:00 +0100 |
commit | 77e38ac1c025b8431d1834a2c1059f9677c78ab1 (patch) | |
tree | aa8dc016303530e56155826f355cb7e3c3a4ee94 /plugins/negate.c | |
parent | 2eea6bb2a04bbfb169bac5f0f7c319f998e8ab87 (diff) | |
parent | eead88edda047843b911afd7b63e7decfee306ce (diff) | |
download | monitoring-plugins-77e38ac.tar.gz |
Merge pull request #1953 from RincewindsHat/compiler_warnings-sign-compare
Fixes for -Wsign-compare
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)))) { |