From 02599650b1ce9e53c837c29db5002e07337a20ab Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 20 May 2007 14:45:38 +0200 Subject: stty: diagnose an invalid hex value in 35-colon commmand-line argument * NEWS: Mention this. * src/stty.c (strtoul_tcflag_t, strtoul_cc_t): New functions. (recover_mode): Use those functions (not sscanf), to parse the string robustly. * tests/stty/invalid: New file. Test for the above. * tests/stty/Makefile.am (TESTS): Add invalid. * .x-sc_prohibit_atoi_atof: Don't exempt stty.c from this check. Add tests/stty/invalid so we don't have to obfuscate the comment about sscanf therein. * Makefile.maint (sc_prohibit_atoi_atof): Mention sscanf in the diagnostic, too. --- Makefile.maint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile.maint') diff --git a/Makefile.maint b/Makefile.maint index 99e4b5c23..795cd99ee 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -122,7 +122,7 @@ sc_space_tab: # Instead, use strto* functions. sc_prohibit_atoi_atof: @grep -nE '\<([fs]?scanf|ato([filq]|ll))\>' $$($(CVS_LIST_EXCEPT)) && \ - { echo '$(ME): do not use *scan''f, ato''f, ato''i, ato''l, ato''ll, or ato''q' \ + { echo '$(ME): do not use *scan''f, ato''f, ato''i, ato''l, ato''ll, ato''q, or ss''canf' \ 1>&2; exit 1; } || : # Using EXIT_SUCCESS as the first argument to error is misleading, -- cgit v1.2.3-54-g00ecf