* lib/glob.c (glob): Prefer SIZE_MAX to ~((size_t) 0), as the
latter is not portable to (probably theoretical) hosts where
SIZE_MAX <= INT_MAX.
---
ChangeLog | 7 +++
lib/glob.c | 6 +++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a8ba38e..4a
* lib/glob.c (__has_builtin): New macro.
(size_add_wrapv, glob_use_alloca): New static functions.
(glob, glob_in_dir): Check for size_t overflow in several places,
and fix some size_t checks that were not quite right.
---
ChangeLog | 6 +++
lib/glob.c | 162 +++--
Bruno Haible writes:
> While your patch is correct, I don't like that much code that
> - does free(NULL) in the main execution path of the code,
> - does computations such as (n == 1 ? msgid : msgid_plural)
> before they turn out to be needed.
> - assigns a variable in several places in