From: Johannes Schindelin Date: Thu, 4 May 2017 13:56:14 +0000 (+0200) Subject: mailinfo & mailsplit: check for EOF while parsing X-Git-Tag: v2.13.1~27^2~17 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/f0733c13ed8b79bb10e240c4b4a6630784c7d258?ds=inline;hp=f0733c13ed8b79bb10e240c4b4a6630784c7d258 mailinfo & mailsplit: check for EOF while parsing While POSIX states that it is okay to pass EOF to isspace() (and it seems to be implied that EOF should *not* be treated as whitespace), and also to pass EOF to ungetc() (which seems to be intended to fail without buffering the character), it is much better to handle these cases explicitly. Not only does it reduce head-scratching (and helps static analysis avoid reporting false positives), it also lets us handle files containing nothing but whitespace by erroring out. Reported via Coverity. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano ---