From: Pierre Habouzit Date: Fri, 05 Oct 2007 08:40:54 GMT Subject: Re: [PATCH] Fix in-place editing in crlf_to_git and ident_to_git. Message-ID: <20071005084054.GH19879@artemis.corp> In-Reply-To: On Fri, Oct 05, 2007 at 08:30:45AM +0000, Johannes Schindelin wrote: > Hi, > > On Fri, 5 Oct 2007, Pierre Habouzit wrote: > > > When crlf_to_git or ident_to_git are called "in place", the buffer > > already is big enough and should not be resized (as it could make the > > buffer address change, hence invalidate the `src' pointers !). > > I wonder why we resize at all if the buffer is big enough to begin with. strbuf_grow takes care of that itself but indeed you make me see that my patch is wrong. if buf->len > len then len - buf->len is err a bit big. I'll roll better ones. -- ·O· Pierre Habouzit ··O madcoder@debian.org OOO http://www.madism.org