Add null check to feof.

Co-authored-by: Jack Grigg <jack@z.cash>
Co-authored-by: Ying Tong Lai <yingtong@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Alfredo Garcia 2020-02-17 17:46:32 -03:00 committed by Daira Hopwood
parent b941974363
commit 868691020e
1 changed files with 1 additions and 1 deletions

View File

@ -566,7 +566,7 @@ public:
// check whether we're at the end of the source file
bool eof() const {
return nReadPos == nSrcPos && feof(src);
return src == NULL || (nReadPos == nSrcPos && feof(src));
}
// read a number of bytes