Re: [PATCH] Fix in-place editing in crlf_to_git and ident_to_git.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx
OOO                                                http://www.madism.org

Attachment: pgppVdhgVTwwy.pgp
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux