blob: 9a71be7f545e8e0a91b58391340527fd11c31aae [file] [log] [blame]
Robert Grieblefd49832002-07-19 20:27:11 +00001/*
2 Copyright (C) 2002 Vladimir Oleynik <dzo@simtreas.ru>
3*/
4
5#include <stdlib.h>
6#include <stdio.h>
7#include <stdarg.h>
8
9
Manuel Novoa III 4d0884a2002-09-12 14:52:26 +000010#include "libbb.h"
Robert Grieblefd49832002-07-19 20:27:11 +000011
12
Robert Grieblefd49832002-07-19 20:27:11 +000013void bb_asprintf(char **string_ptr, const char *format, ...)
14{
15 va_list p;
16
17 va_start(p, format);
Manuel Novoa III 4d0884a2002-09-12 14:52:26 +000018 if(vasprintf(string_ptr, format, p)<0)
19 error_msg_and_die(memory_exhausted);
Robert Grieblefd49832002-07-19 20:27:11 +000020 va_end(p);
21}