Re: [PATCH 7/7] Avoid duplicating memory, and use xmemdupz instead of xstrdup.

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

 



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

Attachment: pgpfHre09hRDF.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