Code

convert PROGANE from a define to a const char
[nagiosplug.git] / plugins / check_http.c
index e6310c8d10a569de6cfea7c7d17651039b04b388..de7a2db7f7b70b70d3917874ddca0a2908df03fc 100644 (file)
@@ -23,7 +23,7 @@
  *
  *****************************************************************************/
 
-#define PROGNAME "check_http"
+const char *progname = "check_http";
 #define REVISION "$Revision$"
 #define COPYRIGHT "1999-2001"
 #define AUTHORS "Ethan Galstad/Karl DeBisschop"
@@ -328,7 +328,7 @@ process_arguments (int argc, char **argv)
                        exit (STATE_OK);
                        break;
                case 'V': /* version */
-                       print_revision (PROGNAME, REVISION);
+                       print_revision (progname, REVISION);
                        exit (STATE_OK);
                        break;
                case 't': /* timeout period */
@@ -527,7 +527,7 @@ check_http (void)
        char *page = "";
        char *auth = NULL;
        int i = 0;
-       size_t pagesize = 1;
+       size_t pagesize = 0;
        char *full_page = "";
        char *buf = NULL;
        char *pos = "";
@@ -650,7 +650,7 @@ check_http (void)
                }
 
                /* send a newline so the server knows we're done with the request */
-               asprintf (&buf, "\r\n\r\n");
+               asprintf (&buf, "\r\n");
                send (sd, buf, strlen (buf), 0);
 #ifdef HAVE_SSL
        }
@@ -1058,7 +1058,7 @@ my_close (void)
 void
 print_help (void)
 {
-       print_revision (PROGNAME, REVISION);
+       print_revision (progname, REVISION);
        printf
                ("Copyright (c) %s %s <%s>\n\n%s\n",
                 COPYRIGHT, AUTHORS, EMAIL, SUMMARY);
@@ -1083,5 +1083,5 @@ print_usage (void)
                " %s -h for detailed help\n"
                " %s -V for version information\n",
 #endif
-       PROGNAME, OPTIONS, PROGNAME, PROGNAME);
+       progname, OPTIONS, progname, progname);
 }