]> granicus.if.org Git - jq/commitdiff
Stop warning on fgets, simple version 139/head
authorBrendan Macmillan <melbourne.research@gmail.com>
Sat, 1 Jun 2013 01:00:26 +0000 (11:00 +1000)
committerBrendan Macmillan <melbourne.research@gmail.com>
Sat, 1 Jun 2013 01:12:28 +0000 (11:12 +1000)
jq_test.c

index d05b7be2195ea4929fff7b1f7ec12d1c231f08e1..30124a8bb1035524b4338bae237444984cfc3040 100644 (file)
--- a/jq_test.c
+++ b/jq_test.c
@@ -2,7 +2,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <errno.h>
 #include "jv.h"
 #include "execute.h"
 
@@ -40,11 +39,7 @@ static void run_jq_tests(FILE *testdata) {
     printf("Disassembly:\n");
     dump_disassembly(2, bc);
     printf("\n");
-    if (!fgets(buf, sizeof(buf), testdata)) {
-      invalid++;
-      printf("%s\n", (errno==0)?"Premature EOF":strerror(errno));
-      break;
-    }
+    if (!fgets(buf, sizeof(buf), testdata)) { invalid++; break; }
     jv input = jv_parse(buf);
     if (!jv_is_valid(input)){ invalid++; continue; }
     jq_init(bc, input, &jq, JQ_DEBUG_TRACE);