Re: [PATCH] Add compat/setenv.c, use in git.c.
- From
Junio C Hamano <junkio@cox.net>
- Date
- Dec 4, 2005, 22:24 UTC
- Message-ID
- <7vy830ec15.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <43935A9E.2060602@zytor.com>
"H. Peter Anvin" <hpa@zytor.com> writes:
> Wouldn't this be a good case for using alloca()?
Perhaps, but considering that (1) this function is not something frequently called anyway, and (2) the proposed change would make it the first alloca() user, and (3) this is compatibility replacement function, I'd rather choose to keep it "old, known to work at more places" malloc/free pair, and not having to worry about it.
But now you quote the patch, sizeof(char) looks funny. Isn't it always 1 by definition?