Blame gl/asprintf.c

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