config: avoid "write_in_full(fd, buf, len) != len" pattern
authorPhillip Wood <redacted>
Wed, 15 Nov 2017 12:40:43 +0000 (12:40 +0000)
committerJunio C Hamano <redacted>
Thu, 16 Nov 2017 01:36:16 +0000 (10:36 +0900)
commitc5e3bc6ec46071397b40582157214d374d1b4fab
treea698b2329a07becd0211adb62f8cb76066c9947c
parente5435ff1fc64d93cce73ec4ee2571219384a92a9
config: avoid "write_in_full(fd, buf, len) != len" pattern

As explained in commit 06f46f237 (avoid "write_in_full(fd, buf, len)
!= len" pattern, 2017–09–13) the return value of write_in_full() is
either -1 or the requested number of bytes. As such comparing the
return value to an unsigned value such as strbuf.len will fail to
catch errors. Change the code to use the preferred '< 0' check.

Signed-off-by: Phillip Wood <redacted>
Signed-off-by: Junio C Hamano <redacted>
config.c
git clone https://git.99rst.org/PROJECT