From 9848747a8eb123ace7acebbee5fed7a5095d960d Mon Sep 17 00:00:00 2001 From: Karl DeBisschop Date: Thu, 14 Nov 2002 04:45:40 +0000 Subject: clean up NULL from status on Solaris git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@195 f882894a-f735-0410-b71e-b25c423dba1c diff --git a/plugins/check_http.c b/plugins/check_http.c index 594a368..e6310c8 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -522,15 +522,15 @@ int check_http (void) { char *msg = NULL; - char *status_line = NULL; + char *status_line = ""; char *header = NULL; - char *page = NULL; + char *page = ""; char *auth = NULL; int i = 0; - size_t pagesize = 0; - char *full_page = NULL; + size_t pagesize = 1; + char *full_page = ""; char *buf = NULL; - char *pos = NULL; + char *pos = ""; char *x = NULL; char *orig_url = NULL; double elapsed_time; @@ -657,8 +657,6 @@ check_http (void) #endif /* fetch the page */ - pagesize = (size_t) 1; - asprintf (&full_page, ""); while ((i = my_recv ()) > 0) { buffer[i] = '\0'; asprintf (&full_page, "%s%s", full_page, buffer); @@ -689,7 +687,7 @@ check_http (void) page += (size_t) strcspn (page, "\r\n"); pos = page; page += (size_t) strspn (page, "\r\n"); - status_line[pos - status_line] = 0; + status_line[strcspn(status_line, "\r\n")] = 0; strip (status_line); if (verbose) printf ("STATUS: %s\n", status_line); -- cgit v0.10-9-g596f