Add a useful sprintf()-style wrapper around
archive_string_vsprintf(). (Which is built on top of libarchive's internal resizable string support.)
This commit is contained in:
parent
4109ba516e
commit
45943bfd93
@ -116,4 +116,7 @@ void __archive_string_vsprintf(struct archive_string *, const char *,
|
|||||||
va_list);
|
va_list);
|
||||||
#define archive_string_vsprintf __archive_string_vsprintf
|
#define archive_string_vsprintf __archive_string_vsprintf
|
||||||
|
|
||||||
|
void __archive_string_sprintf(struct archive_string *, const char *, ...);
|
||||||
|
#define archive_string_sprintf __archive_string_sprintf
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -44,6 +44,16 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include "archive_string.h"
|
#include "archive_string.h"
|
||||||
#include "archive_private.h"
|
#include "archive_private.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
__archive_string_sprintf(struct archive_string *as, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
va_start(ap, fmt);
|
||||||
|
archive_string_vsprintf(as, fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Like 'vsprintf', but ensures the target is big enough, resizing if
|
* Like 'vsprintf', but ensures the target is big enough, resizing if
|
||||||
* necessary.
|
* necessary.
|
||||||
|
Loading…
Reference in New Issue
Block a user