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.
This commit is contained in:
Paul Eggert
2024-11-01 09:40:36 -07:00
parent 989842ff0d
commit d9da938963
2 changed files with 4 additions and 4 deletions

View File

@@ -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,

View File

@@ -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"));
}