From: Paul Eggert Date: Fri, 1 Nov 2024 16:40:36 +0000 (-0700) Subject: Prefer intmax_t for occurrence counts X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d9da9389638dca8b0a94cf2b3458084928d5e267;p=thirdparty%2Ftar.git Prefer intmax_t for occurrence counts * src/common.h (struct name): * src/tar.c (occurrence_option, parse_opt): Use intmax_t, not uintmax_t, for occurrence counts. --- diff --git a/src/common.h b/src/common.h index 4394f50b..15755b7b 100644 --- a/src/common.h +++ b/src/common.h @@ -172,7 +172,7 @@ extern const char *info_script_option; extern bool interactive_option; /* If nonzero, extract only Nth occurrence of each named file */ -extern uintmax_t occurrence_option; +extern intmax_t occurrence_option; enum old_files { @@ -361,7 +361,7 @@ struct name idx_t change_dir; /* Number of the directory to change to. Set with the -C option. */ - uintmax_t found_count; /* number of times a matching file has + intmax_t found_count; /* number of times a matching file has been found */ /* The following members are used for incremental dumps only, diff --git a/src/tar.c b/src/tar.c index 3eb02f43..af02d518 100644 --- a/src/tar.c +++ b/src/tar.c @@ -56,7 +56,7 @@ bool ignore_zeros_option; bool incremental_option; const char *info_script_option; bool interactive_option; -uintmax_t occurrence_option; +intmax_t occurrence_option; enum old_files old_files_option; bool keep_directory_symlink_option; const char *listed_incremental_option; @@ -2007,7 +2007,7 @@ parse_opt (int key, char *arg, struct argp_state *state) else { char *end; - occurrence_option = stoint (arg, &end, NULL, 0, UINTMAX_MAX); + occurrence_option = stoint (arg, &end, NULL, 0, INTMAX_MAX); if (*end) paxfatal (0, "%s: %s", quotearg_colon (arg), _("Invalid number")); }