Back to index

nagios-plugins  1.4.16
asprintf.c
Go to the documentation of this file.
00001 /* Formatted output to strings.
00002    Copyright (C) 1999, 2002, 2006-2007, 2009-2010 Free Software Foundation,
00003    Inc.
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; either version 3, or (at your option)
00008    any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License along
00016    with this program; if not, write to the Free Software Foundation,
00017    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
00018 
00019 #include <config.h>
00020 
00021 /* Specification.  */
00022 #ifdef IN_LIBASPRINTF
00023 # include "vasprintf.h"
00024 #else
00025 # include <stdio.h>
00026 #endif
00027 
00028 #include <stdarg.h>
00029 
00030 int
00031 asprintf (char **resultp, const char *format, ...)
00032 {
00033   va_list args;
00034   int result;
00035 
00036   va_start (args, format);
00037   result = vasprintf (resultp, format, args);
00038   va_end (args);
00039   return result;
00040 }