summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bd6ebce)
raw | patch | inline | side by side (parent: bd6ebce)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Thu, 14 Nov 2002 04:45:40 +0000 (04:45 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Thu, 14 Nov 2002 04:45:40 +0000 (04:45 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@195 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_http.c | patch | blob | history |
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 594a368cd57ac273c54914ec7364b89802a80150..e6310c8d10a569de6cfea7c7d17651039b04b388 100644 (file)
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
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;
#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);
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);