Re: [ANNOUNCE] GIT 1.5.4-rc3

From
Jeff King <hidden>
Date
2016-06-15 22:44:05
Reply to
Johannes Schindelin, 2016-06-15
On Sat, Jan 12, 2008 at 05:57:49PM +0100, Johannes Schindelin wrote:
quoted
 		if (pathspec) {
-			memset(seen, 0, argc);
+			memset(seen, 0, argc > 0 ? argc : 1);
 			matches = match_pathspec(pathspec, ent->name, ent->len,
 						 baselen, seen);
 		} else {
Would it not be better to guard the memset by an "if (argc)", and set 
"seen" to NULL by default?
I am not sure what you mean by "guard with if (argc)"; it needs to be
memset in either case (either with N slots, or with 1 if no argc). Seen
could not be NULL previously, but Rene's patch makes that possible.

-Peff
Thread (12 messages) 12 messages, 5 authors, last reply 2016-06-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help