On Mon, Jan 17, 2022 at 7:53 AM Paul Eggert <egg...@cs.ucla.edu> wrote: > * lib/xstrtol.c: Include intprops.h. > (TYPE_SIGNED): Remove, as intprops.h defines that for us now. > (bkm_scale): Use INT_MULTIPLY_WRAPV instead of checking for > overflow by hand.
Thanks. I've just pushed this, too. xstrtol: remove unnecessary else after return * lib/xstrtol.c (bkm_scale): Drop "else" after return. diff --git a/ChangeLog b/ChangeLog index 2ea372b0e3..ff78fda8f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2022-01-17 Jim Meyering <meyer...@fb.com> + + xstrtol: remove unnecessary else after return + * lib/xstrtol.c (bkm_scale): Drop "else" after return. + 2022-01-16 Paul Eggert <egg...@cs.ucla.edu> xstrtol: simplify integer overflow checking diff --git a/lib/xstrtol.c b/lib/xstrtol.c index 6f5a8bef60..3e2efb2a17 100644 --- a/lib/xstrtol.c +++ b/lib/xstrtol.c @@ -52,8 +52,8 @@ bkm_scale (__strtol_t *x, int scale_factor) *x = *x < 0 ? TYPE_MINIMUM (__strtol_t) : TYPE_MAXIMUM (__strtol_t); return LONGINT_OVERFLOW; } - else - *x = scaled; + + *x = scaled; return LONGINT_OK; }