OSDN Git Service
(root)
/
lha
/
lha.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5fa932b
)
Abort when getc() is failed.
author
Koji Arai
<jca02266@gmail.com>
Sun, 8 May 2016 00:30:41 +0000
(09:30 +0900)
committer
Koji Arai
<jca02266@gmail.com>
Sun, 8 May 2016 00:31:03 +0000
(09:31 +0900)
src/bitio.c
patch
|
blob
|
history
diff --git
a/src/bitio.c
b/src/bitio.c
index
91001ea
..
ac4e61b
100644
(file)
--- a/
src/bitio.c
+++ b/
src/bitio.c
@@
-20,7
+20,11
@@
fillbuf(n) /* Shift bitbuf n bits left, read n bits */
bitbuf = (bitbuf << bitcount) + (subbitbuf >> (CHAR_BIT - bitcount));
if (compsize != 0) {
compsize--;
bitbuf = (bitbuf << bitcount) + (subbitbuf >> (CHAR_BIT - bitcount));
if (compsize != 0) {
compsize--;
- subbitbuf = (unsigned char) getc(infile);
+ int c = getc(infile);
+ if (c == EOF) {
+ fatal_error("cannot read stream");
+ }
+ subbitbuf = (unsigned char)c;
}
else
subbitbuf = 0;
}
else
subbitbuf = 0;