Skip trailing whitespaces when parsing integer options
authorMichael Paquier <michael@paquier.xyz>
Tue, 27 Jul 2021 01:39:05 +0000 (10:39 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 27 Jul 2021 01:39:05 +0000 (10:39 +0900)
commitf7a9a3d4b24a4ad0de7992f01a0dd2a02ccd30a4
treee842018568c7929d3125b7ea9c2f5c1d78bc605f
parent21b3aa9c8faf39ef45a5223681d8947e0a00e7da
Skip trailing whitespaces when parsing integer options

strtoint(), via strtol(), would skip leading whitespaces but the same
rule was not applied for trailing whitespaces, leading to an
inconsistent behavior.  Some tests are changed to cover more this area.

Author: Michael Paquier
Reviewed-by: Kyotaro Horiguchi
Discussion: https://postgr.es/m/YP5Pv0d13Ct+03ve@paquier.xyz
src/bin/pg_basebackup/t/020_pg_receivewal.pl
src/bin/pg_dump/t/001_basic.pl
src/fe_utils/option_utils.c