projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a98d79
)
base64: don't rely on feof returning 0/1
author
Jim Meyering
<meyering@redhat.com>
Fri, 27 Jun 2008 14:26:05 +0000
(16:26 +0200)
committer
Jim Meyering
<meyering@redhat.com>
Fri, 27 Jun 2008 14:26:05 +0000
(16:26 +0200)
* 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
patch
|
blob
|
history
diff --git
a/src/base64.c
b/src/base64.c
index 5067b2832be68c2f063c44dcc6894e876e75be4f..416e573f602f43376c0bfebdb0c7a54beee32ec3 100644
(file)
--- 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;