[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Introduce xasprintf
From: |
Neal H. Walfield |
Subject: |
Re: [PATCH] Introduce xasprintf |
Date: |
Fri, 04 Sep 2009 18:47:17 +0200 |
User-agent: |
Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/22.3 (i486-pc-linux-gnu) MULE/5.0 (SAKAKI) |
At Wed, 2 Sep 2009 02:49:39 +0100,
Colin Watson wrote:
> +#ifndef HAVE_VASPRINTF
> +
> +int
> +vasprintf (char **buf, const char *fmt, va_list ap)
> +{
> + /* Should be large enough. */
> + *buf = xmalloc (512);
> +
> + return vsprintf (*buf, fmt, ap);
> +}
> +
> +#endif
Perhaps check that the number of characters is not more than 512 (if
so, panic).
Neal