]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
tar: Remove unneeded casts
authorTobias Stoeckmann <tobias@stoeckmann.org>
Wed, 9 Jul 2025 20:57:40 +0000 (22:57 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Wed, 9 Jul 2025 20:57:40 +0000 (22:57 +0200)
The variable size is already of type size_t. No need to cast it again
to size_t.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
libarchive/archive_read_support_format_tar.c

index 0c87bc6d732ff025c9f62e87bda3c3d8956865f7..cb5344d6052616ff7ac651348b06aeb82b69ff2f 100644 (file)
@@ -1255,7 +1255,7 @@ read_bytes_to_string(struct archive_read *a,
        const void *src;
 
        /* Fail if we can't make our buffer big enough. */
-       if (archive_string_ensure(as, (size_t)size+1) == NULL) {
+       if (archive_string_ensure(as, size + 1) == NULL) {
                archive_set_error(&a->archive, ENOMEM,
                    "No memory");
                return (ARCHIVE_FATAL);
@@ -1272,9 +1272,9 @@ read_bytes_to_string(struct archive_read *a,
                *unconsumed = 0;
                return (ARCHIVE_FATAL);
        }
-       memcpy(as->s, src, (size_t)size);
+       memcpy(as->s, src, size);
        as->s[size] = '\0';
-       as->length = (size_t)size;
+       as->length = size;
        *unconsumed += size;
        return (ARCHIVE_OK);
 }