Explorar el Código

No data is a failure

Bryan Drewery hace 12 años
padre
commit
a0859bb876
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      src/stringfix.c

+ 4 - 1
src/stringfix.c

@@ -124,14 +124,17 @@ void processline(char *line)
 
 
 int main(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
 {
+  int readData = 0;
+
   if (argc == 2)
   if (argc == 2)
     help = 1;
     help = 1;
   char tempBuf[1024] = "";
   char tempBuf[1024] = "";
   while (!feof(stdin)) {
   while (!feof(stdin)) {
     if (fgets(tempBuf, sizeof(tempBuf), stdin) && !feof(stdin)) {
     if (fgets(tempBuf, sizeof(tempBuf), stdin) && !feof(stdin)) {
       processline(tempBuf);
       processline(tempBuf);
+      readData = 1;
     }
     }
   }
   }
 
 
-  return 0;
+  return !(readData);
 }
 }