From 82e247fe7c9f163f57c5fcbc4bbc37c34d445212 Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Wed, 9 Jul 2025 23:00:38 +0200 Subject: [PATCH] archive_string: Use correct data types 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 --- libarchive/archive_string.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c index 7437715f9..3bb978335 100644 --- a/libarchive/archive_string.c +++ b/libarchive/archive_string.c @@ -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); -- 2.47.3