Skip trailing whitespaces when parsing integer options
Michael Paquier <michael@paquier.xyz>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/pg_basebackup/t/020_pg_receivewal.pl | modified | +3 −1 |
| src/bin/pg_dump/t/001_basic.pl | modified | +2 −1 |
| src/fe_utils/option_utils.c | modified | +8 −1 |
Discussion
- Incorrect usage of strtol, atoi for non-numeric junk inputs 26 messages · 2021-05-19 → 2021-07-27