This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch to use concat instead of xmalloc/sprintf for JAVA dir
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Patch to use concat instead of xmalloc/sprintf for JAVA dir
- From: Richard Henderson <rth at redhat dot com>
- Date: Mon, 23 Apr 2001 14:38:31 -0700
- Cc: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- References: <200104221211.IAA17113@caip.rutgers.edu>
On Sun, Apr 22, 2001 at 08:11:05AM -0400, Kaveh R. Ghazi wrote:
> The xmalloc length calculates enough space for the two strings, the
> "-f" and the "=" (i.e. +3) but not for the trailing NULL.
Actually, it appears to be ok:
> - sprintf (patharg, "-f%s=%s", argv[i]+1, argv[i+1]);
^^
It would have been clearer with that +1 in the strlen argument
as well, with an additional +1 to the constant.
Anyhow, concat is the Correct solution.
r~