diff options
author | Dan Gohman <gohman@apple.com> | 2010-05-31 16:13:45 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-05-31 16:13:45 +0000 |
commit | b6bd72ee7c426f066ffb6e80734cfe1bc43c2cce (patch) | |
tree | c068e2352be6eef51ebea99686901ae5293e5ffd /utils/count | |
parent | c29df3cac735bc85d16e4ef3186cb50e41bec7bb (diff) |
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
Diffstat (limited to 'utils/count')
-rw-r--r-- | utils/count/count.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/count/count.c b/utils/count/count.c index a37e1e0b25..13250198b9 100644 --- a/utils/count/count.c +++ b/utils/count/count.c @@ -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) |