summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/asprintf.c
blob: c82ef019e52fcb4e6cfe97e440c2f81510394b69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include <stdarg.h> // for va_end, va_start
#include <stdio.h>  // for vasprintf, asprintf, va_list

int asprintf(char **restrict ptr, const char *restrict format, ...)
{
	int r;
	va_list ap;
	va_start(ap, format);
	r = vasprintf(ptr, format, ap);
	va_end(ap);
	return r;
}