]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
archive_string: Use correct data types
authorTobias Stoeckmann <tobias@stoeckmann.org>
Wed, 9 Jul 2025 21:00:38 +0000 (23:00 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Wed, 9 Jul 2025 21:06:09 +0000 (23:06 +0200)
If it's already known that we use variables for calculations with
size_t, use size_t for them directly instead of int, even if values
fit.

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

index 7437715f91226f758b0ead507115adcd9cf6f8f0..3bb978335eb876a635d93cb21a96d285fe9dcffe 100644 (file)
@@ -2015,7 +2015,7 @@ archive_strncat_l(struct archive_string *as, const void *_p, size_t n,
        /* We must allocate memory even if there is no data for conversion
         * or copy. This simulates archive_string_append behavior. */
        if (length == 0) {
-               int tn = 1;
+               size_t tn = 1;
                if (sc != NULL && (sc->flag & SCONV_TO_UTF16))
                        tn = 2;
                if (archive_string_ensure(as, as->length + tn) == NULL)
@@ -2752,7 +2752,8 @@ archive_string_append_unicode(struct archive_string *as, const void *_p,
        char *p, *endp;
        uint32_t uc;
        size_t w;
-       int n, ret = 0, ts, tm;
+       size_t ts, tm;
+       int n, ret = 0;
        int (*parse)(uint32_t *, const char *, size_t);
        size_t (*unparse)(char *, size_t, uint32_t);