diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-03-14 22:00:09 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-03-14 22:00:09 +0000 |
commit | 5e403ce9785f2767f7c424293cc6872c9875ed9b (patch) | |
tree | ce8df971fc0c67c8622c228aabc188bf8e4b9701 /lib | |
parent | 3d21898757ea683b1dce39941f6bda43f682c228 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | lib/libarchive/archive_string.h | 3 | ||||
-rw-r--r-- | lib/libarchive/archive_string_sprintf.c | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/libarchive/archive_string.h b/lib/libarchive/archive_string.h index b9b5352..271eae3 100644 --- a/lib/libarchive/archive_string.h +++ b/lib/libarchive/archive_string.h @@ -116,4 +116,7 @@ void __archive_string_vsprintf(struct archive_string *, const char *, va_list); #define archive_string_vsprintf __archive_string_vsprintf +void __archive_string_sprintf(struct archive_string *, const char *, ...); +#define archive_string_sprintf __archive_string_sprintf + #endif 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. |