diff options
| author | Tim Kientzle <kientzle@FreeBSD.org> | 2004-08-31 05:10:36 +0000 |
|---|---|---|
| committer | Tim Kientzle <kientzle@FreeBSD.org> | 2004-08-31 05:10:36 +0000 |
| commit | 98e9f47def5178b70b1f3ea15851b50089052219 (patch) | |
| tree | f6afe8a211f29830ad1f1e0753ca06f95c5cdc4b /lib | |
| parent | 5a238fce1c9132e3524921590c1a9bf6ed4b35a1 (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libarchive/archive_read_extract.c | 2 | ||||
| -rw-r--r-- | lib/libarchive/archive_string_sprintf.c | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/libarchive/archive_read_extract.c b/lib/libarchive/archive_read_extract.c index a8d6961f8794..6dcd753f99d5 100644 --- a/lib/libarchive/archive_read_extract.c +++ b/lib/libarchive/archive_read_extract.c @@ -479,7 +479,7 @@ extract_dir(struct archive *a, struct archive_entry *entry, int flags) if (extract->pst != NULL) { extract->pst = &extract->st; if (S_ISDIR(extract->pst->st_mode)) - goto success; + return (ARCHIVE_OK); /* It exists but isn't a dir. */ if ((flags & ARCHIVE_EXTRACT_UNLINK)) unlink(path); diff --git a/lib/libarchive/archive_string_sprintf.c b/lib/libarchive/archive_string_sprintf.c index 174d2f99eed8..b191b4b25355 100644 --- a/lib/libarchive/archive_string_sprintf.c +++ b/lib/libarchive/archive_string_sprintf.c @@ -47,19 +47,22 @@ __archive_string_vsprintf(struct archive_string *as, const char *fmt, va_list ap) { size_t l; + va_list ap1; if (fmt == NULL) { as->s[0] = 0; return; } + va_copy(ap1, ap); l = vsnprintf(as->s, as->buffer_length, fmt, ap); /* If output is bigger than the buffer, resize and try again. */ if (l+1 >= as->buffer_length) { __archive_string_ensure(as, l + 1); - l = vsnprintf(as->s, as->buffer_length, fmt, ap); + l = vsnprintf(as->s, as->buffer_length, fmt, ap1); } as->length = l; + va_end(ap1); } /* |
