Spaces:
Configuration error
Configuration error
| static inline int vasprintf(char **PTR, const char *TEMPLATE, va_list AP) | |
| { | |
| int res; | |
| char buf[16]; | |
| res = vsnprintf(buf, 16, TEMPLATE, AP); | |
| if (res > 0) { | |
| *PTR = (char*)malloc(res+1); | |
| res = vsnprintf(*PTR, res+1, TEMPLATE, AP); | |
| } | |
| return res; | |
| } | |
| static inline int asprintf(char **PTR, const char *TEMPLATE, ...) | |
| { | |
| int res; | |
| va_list AP; | |
| va_start(AP, TEMPLATE); | |
| res = vasprintf(PTR, TEMPLATE, AP); | |
| va_end(AP); | |
| return res; | |
| } | |