aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_tcp.c')
-rw-r--r--plugins/check_tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index 7bd48d1a..55ce8984 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -206,6 +206,7 @@ main (int argc, char **argv)
server_port = PORT;
server_send = SEND;
server_quit = QUIT;
+ status = strdup ("");
if (process_arguments (argc, argv) == ERROR)
usage (_("Could not parse arguments\n"));
@@ -259,7 +260,6 @@ main (int argc, char **argv)
buffer = malloc (MAXBUF);
memset (buffer, '\0', MAXBUF);
- status = strdup ("");
/* watch for the expect string */
while ((i = my_recv ()) > 0) {
buffer[i] = '\0';
@@ -271,7 +271,7 @@ main (int argc, char **argv)
}
/* return a CRITICAL status if we couldn't read any data */
- if (status == NULL)
+ if (strlen(status) == 0)
die (STATE_CRITICAL, _("No data received from host\n"));
strip (status);