diff options
author | Jia Tan <jiat0218@gmail.com> | 2023-09-24 21:25:01 +0800 |
---|---|---|
committer | Jia Tan <jiat0218@gmail.com> | 2023-09-24 21:25:01 +0800 |
commit | db17656721e43939bfa4ec13506e7c76f4b86da6 (patch) | |
tree | 29fddf14e6326eef2e701052298bdf0367d51428 /lib | |
parent | Build: Update getopt.m4 from Gnulib. (diff) | |
download | xz-db17656721e43939bfa4ec13506e7c76f4b86da6.tar.xz |
lib: Silence -Wsign-conversion in getopt.c.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/getopt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/getopt.c b/lib/getopt.c index 8de50991..5941f6fd 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -213,7 +213,7 @@ process_long_option (int argc, char **argv, const char *optstring, for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; - namelen = nameend - d->__nextchar; + namelen = (size_t)(nameend - d->__nextchar); /* First look for an exact match, counting the options as a side effect. */ @@ -260,7 +260,7 @@ process_long_option (int argc, char **argv, const char *optstring, { if (__libc_use_alloca (n_options)) ambig_set = alloca (n_options); - else if ((ambig_set = malloc (n_options)) == NULL) + else if ((ambig_set = malloc ((size_t)n_options)) == NULL) /* Fall back to simpler error message. */ ambig_fallback = 1; else @@ -268,7 +268,7 @@ process_long_option (int argc, char **argv, const char *optstring, if (ambig_set) { - memset (ambig_set, 0, n_options); + memset (ambig_set, 0, (size_t)n_options); ambig_set[indfound] = 1; } } |