]> pd.if.org Git - ctap/commitdiff
make prove.c compile with additional checks
authorNathan Wagner <nw@hydaspes.if.org>
Thu, 5 Jul 2018 07:45:28 +0000 (07:45 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Thu, 5 Jul 2018 07:45:43 +0000 (07:45 +0000)
prove.c

diff --git a/prove.c b/prove.c
index afb5a73e2c5a16742562a00e1697f413c2582d07..8ff8a6410ded3fb02a77bee17e1ad5aa3d30c853 100644 (file)
--- a/prove.c
+++ b/prove.c
@@ -1,6 +1,9 @@
+#define _POSIX_C_SOURCE 200809L
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <strings.h>
 #include <unistd.h>
 #include <errno.h>
 #include <sys/types.h>
@@ -53,7 +56,8 @@ int runone(struct testrun *run) {
        pid_t cpid;
        FILE *tap;
        char *line;
-       size_t nread, len = 0;
+       ssize_t nread;
+       size_t len = 0;
        int written = 0;
        
        if (pipe(pipefd) == -1) {
@@ -232,7 +236,10 @@ int runone(struct testrun *run) {
 }
 
 void json(struct testrun *total, struct testrun *runs, int nruns) {
-
+       if (total && runs && nruns) {
+               return;
+       }
+       return;
 }
 
 int main(int ac, char *av[]) {