From: Shawn O. Pearce Date: Thu, 29 Oct 2009 21:58:29 GMT Subject: Re: [RFC PATCH v4 03/26] pkt-line: Make packet_read_line easier to debug Message-ID: <20091029215829.GD10505@spearce.org> In-Reply-To: <7v1vkm6id9.fsf@alter.siamese.dyndns.org> Junio C Hamano wrote: > > The NUL assignment isn't about safe_read(), its about making the > > block of 4 bytes read a proper C-style string so we can safely pass > > it down into the snprintf that is within die(). > > I knew and understood all of what you just said. static linelen[] is not > about stack allocation. It's about letting the compiler initialize it to > five NULs so that you do not have to assign NUL to its fifth place before > you die. This removes one added line from your patch. Thanks, I get it now. Patch amended. -- Shawn.