summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_string_sprintf.c
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-03-14 22:00:09 +0000
committerkientzle <kientzle@FreeBSD.org>2008-03-14 22:00:09 +0000
commit5e403ce9785f2767f7c424293cc6872c9875ed9b (patch)
treece8df971fc0c67c8622c228aabc188bf8e4b9701 /lib/libarchive/archive_string_sprintf.c
parent3d21898757ea683b1dce39941f6bda43f682c228 (diff)
downloadFreeBSD-src-5e403ce9785f2767f7c424293cc6872c9875ed9b.zip
FreeBSD-src-5e403ce9785f2767f7c424293cc6872c9875ed9b.tar.gz
Add a useful sprintf()-style wrapper around
archive_string_vsprintf(). (Which is built on top of libarchive's internal resizable string support.)
Diffstat (limited to 'lib/libarchive/archive_string_sprintf.c')
-rw-r--r--lib/libarchive/archive_string_sprintf.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libarchive/archive_string_sprintf.c b/lib/libarchive/archive_string_sprintf.c
index 4401e9a..44b116e 100644
--- a/lib/libarchive/archive_string_sprintf.c
+++ b/lib/libarchive/archive_string_sprintf.c
@@ -44,6 +44,16 @@ __FBSDID("$FreeBSD$");
#include "archive_string.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
* necessary.
OpenPOWER on IntegriCloud