186d7f5d3SJohn Marino /* Formatted output to strings.
286d7f5d3SJohn Marino Copyright (C) 1999, 2002 Free Software Foundation, Inc.
386d7f5d3SJohn Marino
486d7f5d3SJohn Marino This program is free software; you can redistribute it and/or modify
586d7f5d3SJohn Marino it under the terms of the GNU General Public License as published by
686d7f5d3SJohn Marino the Free Software Foundation; either version 2, or (at your option)
786d7f5d3SJohn Marino any later version.
886d7f5d3SJohn Marino
986d7f5d3SJohn Marino This program is distributed in the hope that it will be useful,
1086d7f5d3SJohn Marino but WITHOUT ANY WARRANTY; without even the implied warranty of
1186d7f5d3SJohn Marino MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1286d7f5d3SJohn Marino GNU General Public License for more details.
1386d7f5d3SJohn Marino
1486d7f5d3SJohn Marino You should have received a copy of the GNU General Public License along
1586d7f5d3SJohn Marino with this program; if not, write to the Free Software Foundation,
1686d7f5d3SJohn Marino Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
1786d7f5d3SJohn Marino
1886d7f5d3SJohn Marino #ifdef HAVE_CONFIG_H
1986d7f5d3SJohn Marino # include <config.h>
2086d7f5d3SJohn Marino #endif
2186d7f5d3SJohn Marino
2286d7f5d3SJohn Marino /* Specification. */
2386d7f5d3SJohn Marino #include "vasnprintf.h"
2486d7f5d3SJohn Marino
2586d7f5d3SJohn Marino #include <stdarg.h>
2686d7f5d3SJohn Marino
2786d7f5d3SJohn Marino char *
asnprintf(char * resultbuf,size_t * lengthp,const char * format,...)2886d7f5d3SJohn Marino asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
2986d7f5d3SJohn Marino {
3086d7f5d3SJohn Marino va_list args;
3186d7f5d3SJohn Marino char *result;
3286d7f5d3SJohn Marino
3386d7f5d3SJohn Marino va_start (args, format);
3486d7f5d3SJohn Marino result = vasnprintf (resultbuf, lengthp, format, args);
3586d7f5d3SJohn Marino va_end (args);
3686d7f5d3SJohn Marino return result;
3786d7f5d3SJohn Marino }
38