Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src



Module Name:    src
Committed By:   rillig
Date:           Sun Oct 17 18:13:00 UTC 2021

Modified Files:
        src/tests/usr.bin/indent: opt.0.pro t_errors.sh
        src/usr.bin/indent: args.c indent.c

Log Message:
indent: parse int command line options strictly

On i386 and other platforms where LONG_MAX == INT_MAX, the test
t_errors/option_tabsize_very_large failed since the behavior on integer
overflow differs between ILP32 and LP64 platforms. Noticed by gson@.

Avoid this unintended difference by adding reasonable limits for each of
the integer options and by replacing atoi with strtol.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/opt.0.pro
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/indent/t_errors.sh
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/indent/args.c
cvs rdiff -u -r1.137 -r1.138 src/usr.bin/indent/indent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index