Blame gl/asprintf.c

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