summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-06-27 16:26:05 +0200
committerJim Meyering <meyering@redhat.com>2008-06-27 16:26:05 +0200
commit5cc42f7de6251792a02befab4b3df7b3023135d8 (patch)
tree7e760cc537ede4e29c7b53542775dd1f98626605 /src
parent0a98d79bd268c47588fc356cb7ea73403780aa20 (diff)
downloadcoreutils-5cc42f7de6251792a02befab4b3df7b3023135d8.tar.xz
base64: don't rely on feof returning 0/1
* src/base64.c (do_decode): feof is specified to return nonzero, not 0/1, so use "k < 1 + !!feof(in)" as the loop termination test.
Diffstat (limited to 'src')
-rw-r--r--src/base64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/base64.c b/src/base64.c
index 5067b2832..416e573f6 100644
--- a/src/base64.c
+++ b/src/base64.c
@@ -214,7 +214,7 @@ do_decode (FILE *in, FILE *out, bool ignore_garbage)
However, when it processes the final input buffer, we want
to iterate it one additional time, but with an indicator
telling it to flush what is in CTX. */
- for (k = 0; k < 1 + feof (in); k++)
+ for (k = 0; k < 1 + !!feof (in); k++)
{
if (k == 1 && ctx.i == 0)
break;