From: Jonathan Nieder Date: Wed, 13 Sep 2017 21:17:42 GMT Subject: Re: [PATCH 5/7] pkt-line: check write_in_full() errors against "< 0" Message-ID: <20170913211742.GM27425@aiede.mtv.corp.google.com> In-Reply-To: <20170913171730.ckcebchjhhvtwcsj@sigill.intra.peff.net> Jeff King wrote: > As with the previous two commits, we prefer to check > write_in_full()'s return value to see if it is negative, > rather than comparing it to the input length. > > These cases actually flip the logic to check for success, > making conversion a little different than in other cases. We > could of course write: > > if (write_in_full(...) >= 0) > return 0; > return error(...); > > But our usual method of spelling write() error checks is > just "< 0". So let's flip the logic for each of these > conditionals to our usual style. > > Signed-off-by: Jeff King > --- > pkt-line.c | 29 ++++++++++++++--------------- > 1 file changed, 14 insertions(+), 15 deletions(-) Reviewed-by: Jonathan Nieder