From 5703db4d03b1449ef25cfb568efc08bcbb9634b4 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 1 Jun 2005 15:48:03 +0000 Subject: Add stuff from gnulib. --- gl/asprintf.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 gl/asprintf.c (limited to 'gl/asprintf.c') diff --git a/gl/asprintf.c b/gl/asprintf.c new file mode 100644 index 000000000..7c4e64a24 --- /dev/null +++ b/gl/asprintf.c @@ -0,0 +1,37 @@ +/* Formatted output to strings. + Copyright (C) 1999, 2002 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +/* Specification. */ +#include "vasprintf.h" + +#include + +int +asprintf (char **resultp, const char *format, ...) +{ + va_list args; + int result; + + va_start (args, format); + result = vasprintf (resultp, format, args); + va_end (args); + return result; +} -- cgit