Q: xasprintf

From: Dmitry V. Levin <ldv@altlinux.org>
Date: 2006-05-23 21:28:54
Hi,

On Mon, May 22, 2006 at 06:02:39PM -0700, Junio C Hamano wrote:
> Sean <seanlkml@sympatico.ca> writes:
[...]
> > -		name = xmalloc(len_a + len_b - pfx_length - sfx_length + 7);
> > +		name = xmalloc(pfx_length + a_midlen + b_midlen + sfx_length + 7);
> >  		sprintf(name, "%.*s{%.*s => %.*s}%s",
> 
> Obviously correct given what the sprintf() that immediately
> follows does.  Sheesh, what was I smoking back then.  *BLUSH*

What about introducing xasprintf() to eliminate such issues?


-- 
ldv

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Received on Tue May 23 21:29:37 2006

This archive was generated by hypermail 2.1.8 : 2006-05-23 21:29:57 EST