summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_string.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libarchive/archive_string.h')
-rw-r--r--lib/libarchive/archive_string.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libarchive/archive_string.h b/lib/libarchive/archive_string.h
index f6076a4..6cbe722 100644
--- a/lib/libarchive/archive_string.h
+++ b/lib/libarchive/archive_string.h
@@ -50,14 +50,15 @@ struct archive_string {
size_t buffer_length; /* Length of malloc-ed storage */
};
-#define EMPTY_ARCHIVE_STRING {0,0,0}
+/* Initialize an archive_string object on the stack or elsewhere. */
+#define archive_string_init(a) \
+ do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
/* Append a C char to an archive_string, resizing as necessary. */
struct archive_string *
__archive_strappend_char(struct archive_string *, char);
#define archive_strappend_char __archive_strappend_char
-
/* Append a char to an archive_string using UTF8. */
struct archive_string *
__archive_strappend_char_UTF8(struct archive_string *, int);
@@ -86,7 +87,7 @@ __archive_strncat(struct archive_string *, const char *, size_t);
/* Copy a C string to an archive_string with limit, resizing as necessary. */
#define archive_strncpy(as,p,l) \
- ((as)->length=0,archive_strncat((as), (p), (l)))
+ ((as)->length=0, archive_strncat((as), (p), (l)))
/* Return length of string. */
#define archive_strlen(a) ((a)->length)
OpenPOWER on IntegriCloud