fix a potential end-of-buffer issue in tccelf.c

also read characters one at a time when PARSE_DEBUG is set; after this
patch, things seem to work with that.
This commit is contained in:
Philip
2015-04-30 21:31:32 +00:00
parent 2e04fa8872
commit 951a43ea6c
2 changed files with 6 additions and 3 deletions

View File

@ -386,7 +386,7 @@ static int tcc_peekc_slow(BufferedFile *bf)
if (bf->buf_ptr >= bf->buf_end) {
if (bf->fd != -1) {
#if defined(PARSE_DEBUG)
len = 8;
len = 1;
#else
len = IO_BUF_SIZE;
#endif