From 475cb3f2a1f3c763f1203ba930ce2bf59883639c Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Wed, 6 Feb 2019 02:40:55 +0000 Subject: [PATCH] initialize variable --- t/ctap/prove.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/ctap/prove.c b/t/ctap/prove.c index a419afa..7d1b8e2 100644 --- a/t/ctap/prove.c +++ b/t/ctap/prove.c @@ -11,6 +11,7 @@ #include #define GREATER(x,y) ( ((x) > (y)) ? (x) : (y) ) +#define WARN(x) fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, x) struct result { int test; /* i.e. the number of the test */ @@ -56,7 +57,7 @@ int runone(struct testrun *run) { int pipefd[2]; pid_t cpid; FILE *tap; - char *line; + char *line = 0; ssize_t nread; size_t len = 0; int written = 0; @@ -87,6 +88,10 @@ int runone(struct testrun *run) { close(pipefd[1]); /* parent continue on */ tap = fdopen(pipefd[0], "r"); + if (tap == NULL) { + perror("tap is null:"); + exit(EXIT_FAILURE); + } } else { tap = stdin; } -- 2.40.0