Re: Expose subprojects as special files to "git diff" machinery

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

 



On Sun, Apr 15, 2007 at 12:05:44PM -0700, Linus Torvalds wrote:
> 
> 
> On Sun, 15 Apr 2007, Sam Ravnborg wrote:
> 
> > >  
> > > +static int diff_populate_gitlink(struct diff_filespec *s, int size_only)
> > > +{
> > > +	int len;
> > > +	char *data = xmalloc(100);
> > > +	len = snprintf(data, 100,
> > > +		"Subproject commit %s\n", sha1_to_hex(s->sha1));
> > 
> > In userland I would use a local variable for an array of the size of 100.
> > I would normally only allocate when we are say 5x bigger.
> 
> We're _returning_ the pointer to the caller, so no, we cannot use an 
> automatic array.
Do not know how I missed that...
Thanks,
	Sam
-
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]