From: Pierre Habouzit Date: Fri, 21 Sep 2007 07:03:29 GMT Subject: Re: [PATCH 7/7] Avoid duplicating memory, and use xmemdupz instead of xstrdup. Message-ID: <20070921070329.GB5689@artemis.corp> In-Reply-To: <20070920220506.GC17514@artemis.corp> On jeu, sep 20, 2007 at 10:05:06 +0000, Pierre Habouzit wrote: > On mer, sep 19, 2007 at 10:42:16 +0000, Pierre Habouzit wrote: > > As someone pointed to me off-list the above should be: > + if (rf_one) { > + (*write_ref)[targets] = xmemdupz(rf_one + 1, buf.len - (rf_one + 1 - buf.buf)); > + } else { > > Or better: > + if (rf_one) { > + rf_one++; /* skip \t */ > + (*write_ref)[targets] = xmemdupz(rf_one, buf.buf + buf.len - rf_one); > + } else { > > Which is definitely more readable. damn it was not the error that was reported to me, there is another one, I'll roll a new patch, sorry :/ -- ·O· Pierre Habouzit ··O madcoder@debian.org OOO http://www.madism.org