diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2004-08-02 17:23:19 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2004-08-02 17:23:19 +0000 |
commit | 233d4fe941412085f77aa476332bd1156d73ce19 (patch) | |
tree | aa4fac1fad9bc66f0b65550bd017f8a8cc99e330 /lib | |
parent | 7d3d26e57f2c3cf6ce4b0c715c15300cb10fc918 (diff) | |
download | coreutils-233d4fe941412085f77aa476332bd1156d73ce19.tar.xz |
(argmatch, __xargmatch_internal, argmatch_invalid):
Use ptrdiff_t, not int, when counting arguments, to allow more
than INT_MAX arguments.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/argmatch.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/argmatch.h b/lib/argmatch.h index e8bb23c66..8952394fd 100644 --- a/lib/argmatch.h +++ b/lib/argmatch.h @@ -49,8 +49,8 @@ false ambiguities (i.e., different matches of ARG but corresponding to the same values in VALLIST). */ -int argmatch (char const *arg, char const *const *arglist, - char const *vallist, size_t valsize); +ptrdiff_t argmatch (char const *arg, char const *const *arglist, + char const *vallist, size_t valsize); # define ARGMATCH(Arg, Arglist, Vallist) \ argmatch (Arg, Arglist, (char const *) (Vallist), sizeof *(Vallist)) @@ -63,7 +63,8 @@ extern argmatch_exit_fn argmatch_die; /* Report on stderr why argmatch failed. Report correct values. */ -void argmatch_invalid (char const *context, char const *value, int problem); +void argmatch_invalid (char const *context, char const *value, + ptrdiff_t problem); /* Left for compatibility with the old name invalid_arg */ @@ -85,10 +86,10 @@ void argmatch_valid (char const *const *arglist, /* Same as argmatch, but upon failure, reports a explanation on the failure, and exits using the function EXIT_FN. */ -int __xargmatch_internal (char const *context, - char const *arg, char const *const *arglist, - char const *vallist, size_t valsize, - argmatch_exit_fn exit_fn); +ptrdiff_t __xargmatch_internal (char const *context, + char const *arg, char const *const *arglist, + char const *vallist, size_t valsize, + argmatch_exit_fn exit_fn); /* Programmer friendly interface to __xargmatch_internal. */ |