a simple inline implementation of the GNU functions asprintf() and vasprintf() http://src.kaivo.net/lib/asprintf/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jakob Kaivo 1bff06e054 adjust error check of initial call to vsnprintf() to account for the fact that we always add 1 1 year ago
LICENSE Add LICENSE 1 year ago
README.md Add README.md 1 year ago
asprintf.h adjust error check of initial call to vsnprintf() to account for the fact that we always add 1 1 year ago

README.md

This is a simple inline implementation of the GNU functions asprintf() and vasprintf(). This header requires only a conforming C99 (or higher) compiler and standard library.

The usage is identical to your system's sprintf() and vsprintf(), respectively, except that the first argument is a pointer to a pointer to char, rather than a pointer directly to a char buffer. On a successful call, a new buffer large enough to hold the resulting string is allocated and assigned through the first parameter. This buffer must be passed to free() to avoid memory leaks.