From 67f54c4cd16e3d9b92ed89821090a4bc1250cb87 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 7 Aug 2004 06:43:34 +0000 Subject: [PATCH] (make_hol, hol_append): Don't assume that SIZE_MAX is a valid preprocessor constant. (__argp_basename): Change from "#ifndef _LIBC" to "#ifndef __argp_short_program_name", so that we don't compile these functions for tar. --- lib/argp-help.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/argp-help.c b/lib/argp-help.c index cdf93d4a45..364305ee9c 100644 --- a/lib/argp-help.c +++ b/lib/argp-help.c @@ -439,9 +439,8 @@ make_hol (const struct argp *argp, struct hol_cluster *cluster) hol->short_options = malloc (num_short_options + 1); assert (hol->entries && hol->short_options); -#if SIZE_MAX <= UINT_MAX - assert (hol->num_entries <= SIZE_MAX / sizeof (struct hol_entry)); -#endif + if (SIZE_MAX <= UINT_MAX) + assert (hol->num_entries <= SIZE_MAX / sizeof (struct hol_entry)); /* Fill in the entries. */ so = hol->short_options; @@ -835,9 +834,8 @@ hol_append (struct hol *hol, struct hol *more) malloc (hol_so_len + strlen (more->short_options) + 1); assert (entries && short_options); -#if SIZE_MAX <= UINT_MAX - assert (num_entries <= SIZE_MAX / sizeof (struct hol_entry)); -#endif + if (SIZE_MAX <= UINT_MAX) + assert (num_entries <= SIZE_MAX / sizeof (struct hol_entry)); __mempcpy (__mempcpy (entries, hol->entries, hol->num_entries * sizeof (struct hol_entry)), @@ -1676,7 +1674,7 @@ void __argp_help (const struct argp *argp, FILE *stream, weak_alias (__argp_help, argp_help) #endif -#ifndef _LIBC +#ifndef __argp_short_program_name char *__argp_basename (char *name) { char *short_name = strrchr (name, '/'); -- 2.30.2