From 5cc42f7de6251792a02befab4b3df7b3023135d8 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 27 Jun 2008 16:26:05 +0200 Subject: 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. --- src/base64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3-70-g09d2