aboutsummaryrefslogtreecommitdiff
path: root/argp/argp-help.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-04-04 00:41:39 +0000
committerUlrich Drepper <drepper@redhat.com>2004-04-04 00:41:39 +0000
commitabca9f7f5893adee7d0eac2ca8962b9c5321e0fe (patch)
treefbd2af557eec256cb4733c1b65f771124e474bef /argp/argp-help.c
parent6472c918f768547df3309f11a8158477ac032a5b (diff)
downloadglibc-abca9f7f5893adee7d0eac2ca8962b9c5321e0fe.tar
glibc-abca9f7f5893adee7d0eac2ca8962b9c5321e0fe.tar.gz
glibc-abca9f7f5893adee7d0eac2ca8962b9c5321e0fe.tar.bz2
glibc-abca9f7f5893adee7d0eac2ca8962b9c5321e0fe.zip
Update.
* inet/test-ifaddrs.c: Fight warnings. * argp/argp-help.c: Fight warnings. * include/time.h: Declare __difftime.
Diffstat (limited to 'argp/argp-help.c')
-rw-r--r--argp/argp-help.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/argp/argp-help.c b/argp/argp-help.c
index b7e088ef10..1921e5258e 100644
--- a/argp/argp-help.c
+++ b/argp/argp-help.c
@@ -1,5 +1,5 @@
/* Hierarchial argument parsing help output
- Copyright (C) 1995-2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1995-2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -47,6 +47,7 @@ char *alloca ();
#include <assert.h>
#include <stdarg.h>
#include <ctype.h>
+#include <limits.h>
#ifdef USE_IN_LIBIO
# include <wchar.h>
#endif
@@ -452,8 +453,10 @@ make_hol (const struct argp *argp, struct hol_cluster *cluster)
hol->entries = malloc (sizeof (struct hol_entry) * hol->num_entries);
hol->short_options = malloc (num_short_options + 1);
- assert (hol->entries && hol->short_options
- && hol->num_entries <= SIZE_MAX / sizeof (struct hol_entry));
+ assert (hol->entries && hol->short_options);
+#if SIZE_MAX <= UINT_MAX
+ assert (hol->num_entries <= SIZE_MAX / sizeof (struct hol_entry));
+#endif
/* Fill in the entries. */
so = hol->short_options;
@@ -846,8 +849,10 @@ hol_append (struct hol *hol, struct hol *more)
char *short_options =
malloc (hol_so_len + strlen (more->short_options) + 1);
- assert (entries && short_options
- && num_entries <= SIZE_MAX / sizeof (struct hol_entry));
+ assert (entries && short_options);
+#if SIZE_MAX <= UINT_MAX
+ assert (num_entries <= SIZE_MAX / sizeof (struct hol_entry));
+#endif
__mempcpy (__mempcpy (entries, hol->entries,
hol->num_entries * sizeof (struct hol_entry)),