Blame gnulib/lib/xasprintf.c
|
Packit Service |
51e54d |
/* vasprintf and asprintf with out-of-memory checking.
|
|
Packit Service |
51e54d |
Copyright (C) 1999, 2002-2004, 2006, 2009-2014 Free Software Foundation,
|
|
Packit Service |
51e54d |
Inc.
|
|
Packit Service |
51e54d |
|
|
Packit Service |
51e54d |
This program is free software: you can redistribute it and/or modify
|
|
Packit Service |
51e54d |
it under the terms of the GNU General Public License as published by
|
|
Packit Service |
51e54d |
the Free Software Foundation; either version 3 of the License, or
|
|
Packit Service |
51e54d |
(at your option) any later version.
|
|
Packit Service |
51e54d |
|
|
Packit Service |
51e54d |
This program is distributed in the hope that it will be useful,
|
|
Packit Service |
51e54d |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
51e54d |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
51e54d |
GNU General Public License for more details.
|
|
Packit Service |
51e54d |
|
|
Packit Service |
51e54d |
You should have received a copy of the GNU General Public License
|
|
Packit Service |
51e54d |
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
Packit Service |
51e54d |
|
|
Packit Service |
51e54d |
#include <config.h>
|
|
Packit Service |
51e54d |
|
|
Packit Service |
51e54d |
/* Specification. */
|
|
Packit Service |
51e54d |
#include "xvasprintf.h"
|
|
Packit Service |
51e54d |
|
|
Packit Service |
51e54d |
char *
|
|
Packit Service |
51e54d |
xasprintf (const char *format, ...)
|
|
Packit Service |
51e54d |
{
|
|
Packit Service |
51e54d |
va_list args;
|
|
Packit Service |
51e54d |
char *result;
|
|
Packit Service |
51e54d |
|
|
Packit Service |
51e54d |
va_start (args, format);
|
|
Packit Service |
51e54d |
result = xvasprintf (format, args);
|
|
Packit Service |
51e54d |
va_end (args);
|
|
Packit Service |
51e54d |
|
|
Packit Service |
51e54d |
return result;
|
|
Packit Service |
51e54d |
}
|