From a228492c4bea15a3e6e7bdbfd6631611c97fe92c Mon Sep 17 00:00:00 2001 From: Karl DeBisschop Date: Sat, 9 Aug 2003 06:01:03 +0000 Subject: [PATCH] more pedantic compiler warns git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@672 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/check_dig.c | 4 +- plugins/check_http.c | 1 + plugins/check_load.c | 6 +- plugins/check_mrtg.c | 165 +++++++++++++++++++++------------------ plugins/check_mrtgtraf.c | 119 ++++++++++++++++------------ plugins/check_nwstat.c | 33 +++++--- plugins/check_overcr.c | 26 +++--- plugins/check_ping.c | 32 ++++---- plugins/check_procs.c | 109 ++++++++++++++------------ plugins/check_real.c | 31 ++++---- plugins/utils.c | 6 +- plugins/utils.h | 6 +- 12 files changed, 301 insertions(+), 237 deletions(-) diff --git a/plugins/check_dig.c b/plugins/check_dig.c index 7c39a24..ff16059 100644 --- a/plugins/check_dig.c +++ b/plugins/check_dig.c @@ -97,7 +97,7 @@ main (int argc, char **argv) input_buffer[strcspn (input_buffer, "\r\n")] = '\0'; if (strstr (input_buffer, query_address) == input_buffer) { - asprintf (&output, input_buffer); + output = strdup(input_buffer); result = STATE_OK; } else { @@ -119,7 +119,7 @@ main (int argc, char **argv) result = max_state (result, STATE_WARNING); printf ("%s", input_buffer); if (strlen (output) == 0) - asprintf (&output, 1 + index (input_buffer, ':')); + output = strdup (1 + index (input_buffer, ':')); } (void) fclose (child_stderr); diff --git a/plugins/check_http.c b/plugins/check_http.c index e2047ed..3321d5a 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -992,6 +992,7 @@ print_help (void) { print_revision (progname, revision); + printf (_("Copyright (c) 1999 Ethan Galstad \n")); printf (_(COPYRIGHT), copyright, email); printf (_("\ diff --git a/plugins/check_load.c b/plugins/check_load.c index 4a38e6c..bdb1e55 100644 --- a/plugins/check_load.c +++ b/plugins/check_load.c @@ -45,7 +45,7 @@ void print_usage (void); float wload1 = -1, wload5 = -1, wload15 = -1; float cload1 = -1, cload5 = -1, cload15 = -1; -char *status_line = ""; +char *status_line; @@ -72,7 +72,7 @@ main (int argc, char **argv) float la1, la5, la15; if (process_arguments (argc, argv) == ERROR) - usage ("\n"); + usage ("failed processing arguments\n"); #if HAVE_GETLOADAVG==1 result = getloadavg (la, 3); @@ -122,7 +122,7 @@ main (int argc, char **argv) # endif #endif - if ((la1 == -1) || (la5 == -1) || (la15 == -1)) { + if ((la1 < 0.0) || (la5 < 0.0) || (la15 < 0.0)) { #if HAVE_GETLOADAVG==1 printf (_("Error in getloadavg()\n")); #else diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c index 2a9958d..21efac2 100644 --- a/plugins/check_mrtg.c +++ b/plugins/check_mrtg.c @@ -24,80 +24,10 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" #include "utils.h" -/* original command line: -