8 * asprintf(ret, format, ...):
9 * Do asprintf(3) like GNU and BSD do.
12 asprintf(char ** ret
, const char * format
, ...)
18 /* Figure out how long the string needs to be. */
20 len
= vsnprintf(NULL
, 0, format
, ap
);
26 buflen
= (size_t)(len
) + 1;
28 /* Allocate memory. */
29 if ((*ret
= malloc(buflen
)) == NULL
)
32 /* Actually generate the string. */
34 len
= vsnprintf(*ret
, buflen
, format
, ap
);
This page took 0.020869 seconds and 4 git commands to generate.