diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-11-14 04:45:40 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-11-14 04:45:40 +0000 |
commit | 9848747a8eb123ace7acebbee5fed7a5095d960d (patch) | |
tree | 0d86449aaa3299f87da35379fef8bd934c4d9718 /plugins/check_http.c | |
parent | bd6ebce617692be1d1bcb96f8c3ce466d640dbce (diff) | |
download | monitoring-plugins-9848747a8eb123ace7acebbee5fed7a5095d960d.tar.gz |
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
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r-- | plugins/check_http.c | 14 |
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 | |||
522 | check_http (void) | 522 | check_http (void) |
523 | { | 523 | { |
524 | char *msg = NULL; | 524 | char *msg = NULL; |
525 | char *status_line = NULL; | 525 | char *status_line = ""; |
526 | char *header = NULL; | 526 | char *header = NULL; |
527 | char *page = NULL; | 527 | char *page = ""; |
528 | char *auth = NULL; | 528 | char *auth = NULL; |
529 | int i = 0; | 529 | int i = 0; |
530 | size_t pagesize = 0; | 530 | size_t pagesize = 1; |
531 | char *full_page = NULL; | 531 | char *full_page = ""; |
532 | char *buf = NULL; | 532 | char *buf = NULL; |
533 | char *pos = NULL; | 533 | char *pos = ""; |
534 | char *x = NULL; | 534 | char *x = NULL; |
535 | char *orig_url = NULL; | 535 | char *orig_url = NULL; |
536 | double elapsed_time; | 536 | double elapsed_time; |
@@ -657,8 +657,6 @@ check_http (void) | |||
657 | #endif | 657 | #endif |
658 | 658 | ||
659 | /* fetch the page */ | 659 | /* fetch the page */ |
660 | pagesize = (size_t) 1; | ||
661 | asprintf (&full_page, ""); | ||
662 | while ((i = my_recv ()) > 0) { | 660 | while ((i = my_recv ()) > 0) { |
663 | buffer[i] = '\0'; | 661 | buffer[i] = '\0'; |
664 | asprintf (&full_page, "%s%s", full_page, buffer); | 662 | asprintf (&full_page, "%s%s", full_page, buffer); |
@@ -689,7 +687,7 @@ check_http (void) | |||
689 | page += (size_t) strcspn (page, "\r\n"); | 687 | page += (size_t) strcspn (page, "\r\n"); |
690 | pos = page; | 688 | pos = page; |
691 | page += (size_t) strspn (page, "\r\n"); | 689 | page += (size_t) strspn (page, "\r\n"); |
692 | status_line[pos - status_line] = 0; | 690 | status_line[strcspn(status_line, "\r\n")] = 0; |
693 | strip (status_line); | 691 | strip (status_line); |
694 | if (verbose) | 692 | if (verbose) |
695 | printf ("STATUS: %s\n", status_line); | 693 | printf ("STATUS: %s\n", status_line); |