#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "xasprintf.h"
Go to the source code of this file.
|
int | _vscprintf_so (const char *format, va_list pargs) |
|
int | vasprintf (char **strp, const char *fmt, va_list ap) |
|
int | asprintf (char *strp[], const char *fmt,...) |
|
◆ _vscprintf_so()
int _vscprintf_so |
( |
const char * |
format, |
|
|
va_list |
pargs |
|
) |
| |
Definition at line 16 of file xasprintf.c.
19 va_copy(argcopy, pargs);
20 retval = vsnprintf(NULL, 0, format, argcopy);
◆ asprintf()
int asprintf |
( |
char * |
strp[], |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
◆ vasprintf()
int vasprintf |
( |
char ** |
strp, |
|
|
const char * |
fmt, |
|
|
va_list |
ap |
|
) |
| |
Definition at line 25 of file xasprintf.c.
27 if (len == -1)
return -1;
28 char *str = malloc((
size_t) len + 1);
30 int r = vsnprintf(str, len + 1, fmt, ap);
31 if (r == -1)
return free(str), -1;
References _vscprintf_so().