aboutsummaryrefslogtreecommitdiff
path: root/lib/tar
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-02-20 13:46:12 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-02-20 13:46:12 +0100
commit91df00a92543a45a4916cbaeecbbf70bfa946b78 (patch)
treefe7da4b37b97bd61c677c322e9fe171f59bdddac /lib/tar
parent8bb081ad46bc9ce4387f8efed2d0f13690b4c143 (diff)
Remove ostream_printf
By cobbling together the xattr lines manually in libtar, the need (and thus the function itself) are removed. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/tar')
-rw-r--r--lib/tar/src/write_header.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/tar/src/write_header.c b/lib/tar/src/write_header.c
index 5d98686..ed780b5 100644
--- a/lib/tar/src/write_header.c
+++ b/lib/tar/src/write_header.c
@@ -164,13 +164,21 @@ static int write_schily_xattr(ostream_t *fp, const struct stat *orig,
return -1;
for (it = xattr; it != NULL; it = it->next) {
+ char buffer[64];
+
len = strlen(prefix) + strlen(it->key) + it->value_len + 3;
len += prefix_digit_len(len);
- if (ostream_printf(fp, PRI_SZ " %s%s=",
- len, prefix, it->key) < 0) {
+ sprintf(buffer, PRI_SZ " ", len);
+
+ if (ostream_append(fp, buffer, strlen(buffer)))
+ return -1;
+ if (ostream_append(fp, prefix, strlen(prefix)))
+ return -1;
+ if (ostream_append(fp, it->key, strlen(it->key)))
+ return -1;
+ if (ostream_append(fp, "=", 1))
return -1;
- }
if (ostream_append(fp, it->value, it->value_len))
return -1;
if (ostream_append(fp, "\n", 1))