--- 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);