Commit Graph

14 Commits

Author SHA1 Message Date
christos
5a1e6eb35b document non literal string format 2011-08-17 13:19:09 +00:00
dholland
d6986f611b Rerun valid_format() both before and after unescaping the format
string, in case the format string contains printf conversions
assembled from escape sequences.

A better approach might be to adjust the unescape logic to avoid
generating printf conversions (e.g. convert \x25 to %% instead of %)
but that's somewhat problematic and it's not really worth taking the
trouble.

Running valid_format() only after unescaping would also be somewhat
tidier but makes printing the invalid format string problematic,
because the unescape logic runs in place.

None of these cases are really worth worrying about in detail, but now
at least they don't result in SIGSEGV.

Related to PR 43355.
2010-05-27 08:40:19 +00:00
dholland
76c7c8ecbf Fix valid_format() to be more careful about allowing only valid printf
formats.

Also, accept %a and %A, which are new since this logic was last updated,
and also allow %F even though it's not functionally different from %f.
Document these additions and bump date of man page.

Fixes PR 43355.
2010-05-27 08:30:35 +00:00
lukem
c1ceae17f0 Enable WARNS=4 by default for usr.bin, except for:
awk  bdes  checknr  compile_et  error  gss  hxtool  kgetcred  kinit
	klist  ldd  less  lex  locale  login  m4  man  menuc  mk_cmds
	mklocale  msgc  openssl  rpcgen  rpcinfo  sdiff  spell  ssh
	string2key  telnet  tn3270  verify_krb5_conf  xlint
2009-04-14 22:15:16 +00:00
ginsbach
bfd03efd21 new sentence, new line 2008-11-26 15:03:47 +00:00
lukem
98e5374ccb Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
ginsbach
709ba647ca Remove clause 3 and 4 from TNF licenses 2008-04-30 14:22:14 +00:00
ginsbach
9470f2d15c Fix problem with handling escaped octal and hexadecimal sequences in the -f
format option.  The problem is that the next character after such an escape
was not copied to the output.
2008-01-18 16:16:10 +00:00
garbled
ee8c3b64e9 Add missing DPADD for LIBMATH 2006-01-07 07:12:27 +00:00
ginsbach
cf8e68cb39 Add missing 'by' in license attribution -- Thanks, wiz! 2005-01-20 12:52:03 +00:00
wiz
704c845e60 Sync usage with man page. 2005-01-20 09:20:03 +00:00
wiz
c6bb1f479a Add RCS Id; sort option(s) without arguments before options with,
in SYNOPSIS; add prompts in examples; sort format letters as option letters would be sorted.
2005-01-20 09:18:11 +00:00
wiz
99cb01f31a Drop trailing whitespace. 2005-01-20 09:13:16 +00:00
ginsbach
e8c2320896 seq(1) - print sequences of numbers 2005-01-20 04:13:42 +00:00