Blame glib/gnulib/asnprintf.c

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