Thread (21 messages) flat view 21 messages, 3 authors, 2016-06-15

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

From: Wincent Colaiuta <hidden>
Date: 2016-06-15 22:43:53

El 22/11/2007, a las 11:33, Jeff King escribió:
On Thu, Nov 22, 2007 at 11:28:17AM +0100, Wincent Colaiuta wrote:
quoted
quoted
quoted
+	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).
True, argv will never be NULL. We'll still be doing a zero-byte memcpy  
though, which I guess is not a big deal here. I'll drop the conditional.

Cheers,
Wincent
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help