2002-07-19 20:27:11 +00:00
|
|
|
/*
|
|
|
|
Copyright (C) 2002 Vladimir Oleynik <dzo@simtreas.ru>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
2002-09-12 14:52:26 +00:00
|
|
|
#include "libbb.h"
|
2002-07-19 20:27:11 +00:00
|
|
|
|
2003-03-19 09:13:01 +00:00
|
|
|
void bb_xasprintf(char **string_ptr, const char *format, ...)
|
2002-07-19 20:27:11 +00:00
|
|
|
{
|
2003-03-19 09:13:01 +00:00
|
|
|
va_list p;
|
|
|
|
int r;
|
2004-03-15 08:29:22 +00:00
|
|
|
|
2003-03-19 09:13:01 +00:00
|
|
|
va_start(p, format);
|
|
|
|
r = vasprintf(string_ptr, format, p);
|
|
|
|
va_end(p);
|
2002-07-19 20:27:11 +00:00
|
|
|
|
2003-03-19 09:13:01 +00:00
|
|
|
if (r < 0) {
|
|
|
|
bb_perror_msg_and_die("bb_xasprintf");
|
|
|
|
}
|
2002-07-19 20:27:11 +00:00
|
|
|
}
|