Selaa lähdekoodia

Fix --no-body

Manually doing what was done in pull request #270. For some reason,
it didn't get brought across from `maint` branch into `release-2.3.0-working`
John C. Frickson 8 vuotta sitten
vanhempi
commit
77ece83b3d
3 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 1 0
      NEWS
  2. 1 0
      THANKS.in
  3. 1 1
      plugins/check_http.c

+ 1 - 0
NEWS

@@ -20,6 +20,7 @@ This file documents the major additions and syntax changes between releases.
 	check_log does not check for "-O oldlog"
 	check_log lost ability to use regexes for query (-q) in 2.1.4
 	fix configure.ac for FreeBSD SWAPFORMAT
+	Fix --no-body
 
 
 2.2.1 2017-04-19

+ 1 - 0
THANKS.in

@@ -49,6 +49,7 @@ Charles-Henri Larose
 Charlie Cook
 Chester Hosey
 Chris Grim
+Chris Heath
 Chris Pepper
 Chris Wilson
 Christian G Warden

+ 1 - 1
plugins/check_http.c

@@ -1218,7 +1218,7 @@ check_http (void)
   /* find header info and null-terminate it */
   header = page;
 	for (;;) {
-		if (!strncmp(page, "\r\n\r\n", 4) || !strncmp(page, "\n\n", 2))
+		if (!*page || !strncmp(page, "\r\n\r\n", 4) || !strncmp(page, "\n\n", 2))
 		 break;
 		while (*page == '\r' || *page == '\n') { ++page; }
     page += (size_t) strcspn (page, "\r\n");