]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Redo 1e660621b4b00eaf4ef7a508aedf52c5a421bd2e, only skip the memmove.
authorJoerg Sonnenberger <joerg@bec.de>
Sat, 29 Apr 2017 13:50:24 +0000 (15:50 +0200)
committerJoerg Sonnenberger <joerg@bec.de>
Sat, 29 Apr 2017 13:50:24 +0000 (15:50 +0200)
libarchive/archive_string.c

index ca39c069ab61ebcb261da821eb8c013452679a40..5ae09b626cbcf9ecad0ab98960e3f689c5c1f951 100644 (file)
@@ -200,11 +200,10 @@ static int archive_string_append_unicode(struct archive_string *,
 static struct archive_string *
 archive_string_append(struct archive_string *as, const char *p, size_t s)
 {
-       if (s == 0)
-               return (as);
        if (archive_string_ensure(as, as->length + s + 1) == NULL)
                return (NULL);
-       memmove(as->s + as->length, p, s);
+       if (s)
+               memmove(as->s + as->length, p, s);
        as->length += s;
        as->s[as->length] = 0;
        return (as);