summaryrefslogtreecommitdiffstats
path: root/web/attachments/35776-check_tcp.diff
blob: b461a639d48749c669232401a5715dc9172d2d23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--- check_tcp.c.orig	Wed Nov 20 12:15:44 2002
+++ check_tcp.c	Wed Nov 20 12:15:03 2002
@@ -241,19 +241,20 @@
 
 		/* watch for the expect string */
 #ifdef HAVE_SSL
-		if (use_ssl && SSL_read (ssl, buffer, MAX_INPUT_BUFFER - 1)>=0)
+		if (use_ssl && SSL_read (ssl, buffer, MAX_INPUT_BUFFER - 1)>0)
 			status = strscat(status,buffer);
 		else
 #endif
 			{
-				if (recv (sd, buffer, MAX_INPUT_BUFFER - 1, 0) >= 0)
+				if (recv (sd, buffer, MAX_INPUT_BUFFER - 1, 0) > 0)
 					status = strscat (status, buffer);
 			}
-		strip (status);
 
 		/* return a CRITICAL status if we couldn't read any data */
 		if (status == NULL)
 			terminate (STATE_CRITICAL, "No data received from host\n");
+
+		strip (status);
 
 		if (status && verbose)
 			printf ("%s\n", status);