Re: [PATCH 3/4] Teach builtin-add to pass multiple paths to git-add--interactive

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

 



On Thu, Nov 22, 2007 at 11:28:17AM +0100, Wincent Colaiuta wrote:

>>> +	memcpy((void *)args + sizeof(const char *), argv, sizeof(const char *) * 
>>> argc);
>>
>> The source for the memcpy (argv) is sometimes NULL. The standard forbids
>> this, even when the size field is 0. I have no idea if any reasonable
>> implementations actually care.
>
> Good point. I've now conditionalized the memcpy with an "if (argc > 0)". 
> While I was at it I also got rid of the unneeded cast to void *.

I don't think you need it if you do the other cleanup (since you will
always be passing a valid argv pointer).

-Peff
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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