aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_http.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r--plugins/check_http.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 594a368c..e6310c8d 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);