Code

Strip leading spaces on dns return value (689563 - Simon L Nielsen)
[nagiosplug.git] / plugins / check_time.c
index c38178052d6434b8ba5790520efadd00b3eea4c5..e4bd26d7f7fc24c5cb34eb5836d08e300dbcc07f 100644 (file)
@@ -39,7 +39,7 @@
 #include "netutils.h"
 #include "utils.h"
 
-#define PROGNAME "check_time"
+const char *progname = "check_time";
 #define REVISION "$Revision$"
 #define COPYRIGHT "1999-2002"
 #define AUTHOR "Ethan Galstad"
@@ -93,12 +93,12 @@ main (int argc, char **argv)
                else
                        result = STATE_UNKNOWN;
                terminate (result,
-                                                        "TIME UNKNOWN - could not connect to server %s, port %d\n",
-                                                        server_address, server_port);
+                          "TIME UNKNOWN - could not connect to server %s, port %d\n",
+                          server_address, server_port);
        }
 
        /* watch for the connection string */
-       result = recv (sd, &raw_server_time, sizeof (raw_server_time), 0);
+       result = recv (sd, (void *)&raw_server_time, sizeof (raw_server_time), 0);
 
        /* close the connection */
        close (sd);
@@ -209,7 +209,7 @@ process_arguments (int argc, char **argv)
                        print_help ();
                        exit (STATE_OK);
                case 'V':                                                                       /* version */
-                       print_revision (PROGNAME, REVISION);
+                       print_revision (progname, REVISION);
                        exit (STATE_OK);
                case 'H':                                                                       /* hostname */
                        if (is_host (optarg) == FALSE)
@@ -306,7 +306,7 @@ print_usage (void)
                 "           [-W connect_time] [-C connect_time] [-t timeout]\n"
                 " %s (-h | --help) for detailed help\n"
                 " %s (-V | --version) for version information\n",
-                PROGNAME, PROGNAME, PROGNAME);
+                progname, progname, progname);
 }
 
 
@@ -316,7 +316,7 @@ print_usage (void)
 void
 print_help (void)
 {
-       print_revision (PROGNAME, REVISION);
+       print_revision (progname, REVISION);
        printf
                ("Copyright (c) %s %s <%s>\n\n%s\n",
                 COPYRIGHT, AUTHOR, EMAIL, SUMMARY);