Blame gnulib/lib/asprintf.c

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