Turn unmatched_count into a size_t to support as many entries as
possible on the machine.
If more than INT_MAX entries are not matched, truncate the result
of archive_match_path_unmatched_inclusions for external callers.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
#include "archive.h"
#include "archive_private.h"
struct match_list {
struct match *first;
struct match **last;
- int unmatched_count;
+ size_t unmatched_count;
struct match *unmatched_next;
int unmatched_eof;
};
ARCHIVE_STATE_NEW, "archive_match_unmatched_inclusions");
a = (struct archive_match *)_a;
- return (a->inclusions.unmatched_count);
+ if (a->inclusions.unmatched_count > (size_t)INT_MAX)
+ return INT_MAX;
+ return (int)(a->inclusions.unmatched_count);
}
int