Rev 5191 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5191 | Rev 6324 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* Like sprintf but provides a pointer to malloc'd storage, which must |
1 | /* Like sprintf but provides a pointer to malloc'd storage, which must |
2 | be freed by the caller. |
2 | be freed by the caller. |
3 | Copyright (C) 1997, 2003 Free Software Foundation, Inc. |
3 | Copyright (C) 1997, 2003, 2013 Free Software Foundation, Inc. |
4 | Contributed by Cygnus Solutions. |
4 | Contributed by Cygnus Solutions. |
Line 5... | Line 5... | ||
5 | 5 | ||
6 | This file is part of the libiberty library. |
6 | This file is part of the libiberty library. |
7 | Libiberty is free software; you can redistribute it and/or |
7 | Libiberty is free software; you can redistribute it and/or |
Line 45... | Line 45... | ||
45 | 45 | ||
46 | int |
46 | int |
47 | asprintf (char **buf, const char *fmt, ...) |
47 | asprintf (char **buf, const char *fmt, ...) |
48 | { |
48 | { |
49 | int status; |
49 | int status; |
50 | VA_OPEN (ap, fmt); |
50 | va_list ap; |
51 | VA_FIXEDARG (ap, char **, buf); |
- | |
52 | VA_FIXEDARG (ap, const char *, fmt); |
51 | va_start (ap, fmt); |
53 | status = vasprintf (buf, fmt, ap); |
52 | status = vasprintf (buf, fmt, ap); |
54 | VA_CLOSE (ap); |
53 | va_end (ap); |
55 | return status; |
54 | return status; |