diff options
author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2022-03-26 15:28:24 +0100 |
---|---|---|
committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2022-03-26 15:28:24 +0100 |
commit | dd7af2d6b6269a529972c3e473cf8297670a01ce (patch) | |
tree | de147d87a31a3e4cfa43940d5b989e82bf7c391d | |
parent | 066b6e68242b5e7a6f1eb665df9b227d896aec66 (diff) | |
download | monitoring-plugins-dd7af2d6b6269a529972c3e473cf8297670a01ce.tar.gz |
Fix compiler warnings due to implizit conversion and formats
-rw-r--r-- | plugins/check_load.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/check_load.c b/plugins/check_load.c index 0e4de54e..dafe8cc4 100644 --- a/plugins/check_load.c +++ b/plugins/check_load.c | |||
@@ -101,7 +101,7 @@ get_threshold(char *arg, double *th) | |||
101 | int | 101 | int |
102 | main (int argc, char **argv) | 102 | main (int argc, char **argv) |
103 | { | 103 | { |
104 | int result; | 104 | int result = -1; |
105 | int i; | 105 | int i; |
106 | long numcpus; | 106 | long numcpus; |
107 | 107 | ||
@@ -164,7 +164,7 @@ main (int argc, char **argv) | |||
164 | sscanf (input_buffer, "%*[^l]load averages: %lf, %lf, %lf", &la1, &la5, &la15); | 164 | sscanf (input_buffer, "%*[^l]load averages: %lf, %lf, %lf", &la1, &la5, &la15); |
165 | } | 165 | } |
166 | else { | 166 | else { |
167 | printf (_("could not parse load from uptime %s: %s\n"), PATH_TO_UPTIME, result); | 167 | printf (_("could not parse load from uptime %s: %d\n"), PATH_TO_UPTIME, result); |
168 | return STATE_UNKNOWN; | 168 | return STATE_UNKNOWN; |
169 | } | 169 | } |
170 | 170 | ||
@@ -384,8 +384,8 @@ static int print_top_consuming_processes() { | |||
384 | #ifdef PS_USES_PROCPCPU | 384 | #ifdef PS_USES_PROCPCPU |
385 | qsort(chld_out.line + 1, chld_out.lines - 1, sizeof(char*), cmpstringp); | 385 | qsort(chld_out.line + 1, chld_out.lines - 1, sizeof(char*), cmpstringp); |
386 | #endif /* PS_USES_PROCPCPU */ | 386 | #endif /* PS_USES_PROCPCPU */ |
387 | int lines_to_show = chld_out.lines < (n_procs_to_show + 1) | 387 | int lines_to_show = chld_out.lines < (size_t)(n_procs_to_show + 1) |
388 | ? chld_out.lines : n_procs_to_show + 1; | 388 | ? (int)chld_out.lines : n_procs_to_show + 1; |
389 | for (i = 0; i < lines_to_show; i += 1) { | 389 | for (i = 0; i < lines_to_show; i += 1) { |
390 | printf("%s\n", chld_out.line[i]); | 390 | printf("%s\n", chld_out.line[i]); |
391 | } | 391 | } |