Fix count so that it doesn't make an extra fread call after

EOF is detected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105223 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2010-05-31 16:13:45 +00:00
parent c29df3cac7
commit b6bd72ee7c

View 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)