Fix count so that it doesn't make an extra fread call after
[oota-llvm.git] / utils / count / count.c
index a37e1e0b25480f46ccebd655654e67639e82389a..13250198b9e4d7d29262a8c0ab643f85e020e134 100644 (file)
@@ -26,7 +26,7 @@ int main(int argc, char **argv) {
   }
 
   NumLines = 0;
-  while ((NumRead = fread(Buffer, 1, sizeof(Buffer), stdin)){
+  while ((NumRead = fread(Buffer, 1, sizeof(Buffer), stdin)) == sizeof(Buffer)){
     unsigned i;
 
     for (i = 0; i != NumRead; ++i)