+2003-09-25 Karl Berry <karl@gnu.org>
+
+ * install-sh: update from automake.
+
2003-09-14 Karl Berry <karl@gnu.org>
* srclist.txt (strdup.c): disable for c89 changes.
+2003-09-25 Karl Berry <karl@gnu.org>
+
+ * argp-fmtstream.c, argp-help.c: update from libc.
+
2003-09-25 Bruno Haible <bruno@clisp.org>
* version-etc-2.h: New file, from version-etc.h with modifications.
if ((size_t) (fs->end - fs->buf) < amount)
/* Gotta grow the buffer. */
{
- size_t new_size = fs->end - fs->buf + amount;
- char *new_buf = realloc (fs->buf, new_size);
+ size_t old_size = fs->end - fs->buf;
+ size_t new_size = old_size + amount;
+ char *new_buf;
- if (! new_buf)
+ if (new_size < old_size || ! (new_buf = realloc (fs->buf, new_size)))
{
__set_errno (ENOMEM);
return 0;
#include "argp.h"
#include "argp-fmtstream.h"
#include "argp-namefrob.h"
+
+#ifndef SIZE_MAX
+# define SIZE_MAX ((size_t) -1)
+#endif
\f
/* User-selectable (using an environment variable) formatting parameters.
hol->entries = malloc (sizeof (struct hol_entry) * hol->num_entries);
hol->short_options = malloc (num_short_options + 1);
- assert (hol->entries && hol->short_options);
+ assert (hol->entries && hol->short_options
+ && hol->num_entries <= SIZE_MAX / sizeof (struct hol_entry));
/* Fill in the entries. */
so = hol->short_options;
char *short_options =
malloc (hol_so_len + strlen (more->short_options) + 1);
+ assert (entries && short_options
+ && num_entries <= SIZE_MAX / sizeof (struct hol_entry));
+
__mempcpy (__mempcpy (entries, hol->entries,
hol->num_entries * sizeof (struct hol_entry)),
more->entries,