chiark / gitweb /
fileio: try to read one byte too much in read_full_stream()
authorLennart Poettering <lennart@poettering.net>
Fri, 22 Sep 2017 19:03:33 +0000 (21:03 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 22 Sep 2017 19:03:33 +0000 (21:03 +0200)
commit23223261b38be3b59c7bf2bd824eb69db425f29b
treec73c129e87da67181718ef680d496e01e8937891
parentf030d15c1e3b2279c7bcd71b817cdbcf56ca74de
fileio: try to read one byte too much in read_full_stream()

Let's read one byte more than the file size we read from stat() on the
first fread() invocation. That way, the first read() will already be
short and indicate eof to fread().

This is a minor optimization, and replaces #3908.
src/basic/fileio.c