* gas/sh/err-le.s, gas/sh/err-be.s: New tests.
[deliverable/binutils-gdb.git] / libiberty / asprintf.c
CommitLineData
252b5132
RH
1/* Like sprintf but provides a pointer to malloc'd storage, which must
2 be freed by the caller.
3 Copyright (C) 1997 Free Software Foundation, Inc.
4 Contributed by Cygnus Solutions.
5
6This file is part of the libiberty library.
7Libiberty is free software; you can redistribute it and/or
8modify it under the terms of the GNU Library General Public
9License as published by the Free Software Foundation; either
10version 2 of the License, or (at your option) any later version.
11
12Libiberty is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15Library General Public License for more details.
16
17You should have received a copy of the GNU Library General Public
18License along with libiberty; see the file COPYING.LIB. If
19not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22#include "ansidecl.h"
23#include "libiberty.h"
24
843f21be 25#ifdef ANSI_PROTOTYPES
252b5132
RH
26#include <stdarg.h>
27#else
28#include <varargs.h>
29#endif
30
252b5132 31int
843f21be 32asprintf VPARAMS ((char **buf, const char *fmt, ...))
252b5132
RH
33{
34 int status;
843f21be
DD
35 VA_OPEN (ap, fmt);
36 VA_FIXEDARG (ap, char **, buf);
37 VA_FIXEDARG (ap, const char *, fmt);
252b5132 38 status = vasprintf (buf, fmt, ap);
843f21be 39 VA_CLOSE (ap);
252b5132
RH
40 return status;
41}
This page took 0.113724 seconds and 4 git commands to generate.