From dd7af2d6b6269a529972c3e473cf8297670a01ce Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Sat, 26 Mar 2022 15:28:24 +0100 Subject: Fix compiler warnings due to implizit conversion and formats --- plugins/check_load.c | 8 ++++---- 1 file 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) int main (int argc, char **argv) { - int result; + int result = -1; int i; long numcpus; @@ -164,7 +164,7 @@ main (int argc, char **argv) sscanf (input_buffer, "%*[^l]load averages: %lf, %lf, %lf", &la1, &la5, &la15); } else { - printf (_("could not parse load from uptime %s: %s\n"), PATH_TO_UPTIME, result); + printf (_("could not parse load from uptime %s: %d\n"), PATH_TO_UPTIME, result); return STATE_UNKNOWN; } @@ -384,8 +384,8 @@ static int print_top_consuming_processes() { #ifdef PS_USES_PROCPCPU qsort(chld_out.line + 1, chld_out.lines - 1, sizeof(char*), cmpstringp); #endif /* PS_USES_PROCPCPU */ - int lines_to_show = chld_out.lines < (n_procs_to_show + 1) - ? chld_out.lines : n_procs_to_show + 1; + int lines_to_show = chld_out.lines < (size_t)(n_procs_to_show + 1) + ? (int)chld_out.lines : n_procs_to_show + 1; for (i = 0; i < lines_to_show; i += 1) { printf("%s\n", chld_out.line[i]); } -- cgit v1.2.3-74-g34f1