diff lib/argp-help.c @ 16135:a947b7cecbfe

Avoid subtracting two pointers that don't point into the same block. * lib/argp-help.c (hol_append): Reorder pointer subtractions so that only pointers into the same memory block are subtracted. We cannot assume that sizeof (ptrdiff_t) == sizeof (void *).
author Matthew Wala <wala1@illinois.edu>
date Wed, 30 Nov 2011 01:44:15 +0100 (2011-11-30)
parents 1d39813ecc60
children 8250f2777afc
line wrap: on
line diff
--- a/lib/argp-help.c
+++ b/lib/argp-help.c
@@ -891,7 +891,8 @@
 
           /* Fix up the short options pointers from HOL.  */
           for (e = entries, left = hol->num_entries; left > 0; e++, left--)
-            e->short_options += (short_options - hol->short_options);
+            e->short_options =
+              short_options + (e->short_options - hol->short_options);
 
           /* Now add the short options from MORE, fixing up its entries
              too.  */