[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnulib] How about a vasprintf()?
From: |
Bruno Haible |
Subject: |
Re: [Bug-gnulib] How about a vasprintf()? |
Date: |
Fri, 29 Nov 2002 15:23:13 +0100 (CET) |
Simon Josefsson writes:
> I found this in GNU Mailutils, not sure where it comes from.
> Something for gnulib?
This code was also in gettext for some time. It is hopelessly out of
date:
- Wrong return value when memory allocation fails.
- Doesn't support format directives like 'F' or 'z' or 'ls'.
- Doesn't support long doubles.
- Doesn't support reordered arguments.
- Allocates way too much memory in some cases.
This old code is safe to use only with a very limited set of format
strings.
If there is no objection, I'll add a complete rewrite of asprintf,
vasprintf, asnprintf, vasnprintf to gnulib. (Taken from GNU gettext,
of course :-)). It's a set of 10 files; probably I'll add them to a
separate subdirectory libasprintf or so, in order not to clutter up
the lib/ directory.
Bruno
asprintf.tar.gz
Description: asprintf.tar.gz