xar: Switch from int to size_t API (#2195)

Most of the functions already use size_t for sizes. Do the same for
xml_data. The libraries expat and libxml2 do not support strings larger
than 2 GB (limit is less than this) but it fixes one last Visual Studio
compiler warning which I missed previously.
This commit is contained in:
Tobias Stoeckmann authored and GitHub committed 2024-05-17 21:36:22 -07:00
1 parent d33f44ad5c
commit adf7388139
1 file changed
+3 -3
+3 -3
View File
@@ -416,7 +416,7 @@ static void unknowntag_end(struct xar *, const char *);
static int xml_start(struct archive_read *,
const char *, struct xmlattr_list *);
static void xml_end(void *, const char *);
static void xml_data(void *, const char *, int);
static void xml_data(void *, const char *, size_t);
static int xml_parse_file_flags(struct xar *, const char *);
static int xml_parse_file_ext2(struct xar *, const char *);
#if defined(HAVE_LIBXML_XMLREADER_H)
@@ -2674,7 +2674,7 @@ is_string(const char *known, const char *data, size_t len)
}
static void
xml_data(void *userData, const char *s, int len)
xml_data(void *userData, const char *s, size_t len)
{
struct archive_read *a;
struct xar *xar;
@@ -3280,7 +3280,7 @@ expat_data_cb(void *userData, const XML_Char *s, int len)
{
struct expat_userData *ud = (struct expat_userData *)userData;
xml_data(ud->archive, s, len);
xml_data(ud->archive, s, (size_t)len);
}
static int