Blame gnulib/lib/asprintf.c
|
Packit Service |
a2ae7a |
/* Formatted output to strings.
|
|
Packit Service |
a2ae7a |
Copyright (C) 1999, 2002, 2006-2007, 2009-2019 Free Software Foundation,
|
|
Packit Service |
a2ae7a |
Inc.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
This program is free software; you can redistribute it and/or modify
|
|
Packit Service |
a2ae7a |
it under the terms of the GNU Lesser General Public License as published by
|
|
Packit Service |
a2ae7a |
the Free Software Foundation; either version 2.1, or (at your option)
|
|
Packit Service |
a2ae7a |
any later version.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
This program is distributed in the hope that it will be useful,
|
|
Packit Service |
a2ae7a |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
a2ae7a |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
a2ae7a |
GNU Lesser General Public License for more details.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
You should have received a copy of the GNU Lesser General Public License along
|
|
Packit Service |
a2ae7a |
with this program; if not, see <https://www.gnu.org/licenses/>. */
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
#include <config.h>
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
/* Specification. */
|
|
Packit Service |
a2ae7a |
#ifdef IN_LIBASPRINTF
|
|
Packit Service |
a2ae7a |
# include "vasprintf.h"
|
|
Packit Service |
a2ae7a |
#else
|
|
Packit Service |
a2ae7a |
# include <stdio.h>
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
#include <stdarg.h>
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
int
|
|
Packit Service |
a2ae7a |
asprintf (char **resultp, const char *format, ...)
|
|
Packit Service |
a2ae7a |
{
|
|
Packit Service |
a2ae7a |
va_list args;
|
|
Packit Service |
a2ae7a |
int result;
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
va_start (args, format);
|
|
Packit Service |
a2ae7a |
result = vasprintf (resultp, format, args);
|
|
Packit Service |
a2ae7a |
va_end (args);
|
|
Packit Service |
a2ae7a |
return result;
|
|
Packit Service |
a2ae7a |
}
|