# HG changeset patch # User Matthew Wala # Date 1322613855 -3600 # Node ID a947b7cecbfeae025c8527291e0db85f60ae2517 # Parent 456f788a2768431937e99415b404023123e21c80 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 *). diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-11-29 Matthew Wala (tiny change) + + 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 *). + 2011-11-29 Eric Blake maint.mk: add syntax check for use of compare from init.sh diff --git a/lib/argp-help.c b/lib/argp-help.c --- 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. */