1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-20 02:38:43 +00:00

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:
Tim Kientzle 2008-03-14 22:00:09 +00:00
parent 4109ba516e
commit 45943bfd93
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=177185
2 changed files with 13 additions and 0 deletions

View File

@ -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

View File

@ -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.