[illumos-Developer] webrev: printf

Guido Berhoerster guido+illumos.org at berhoerster.name
Thu Oct 14 12:00:18 PDT 2010


* Kyle McDonald <kmcdonald at egenera.com> [2010-10-14 20:17]:
> Whether that is right or wrong, I imagine the 'and treat the remaining
> option data as the format' is wrong.
> 
> If you accept the -whatever as a non-option and are willing to print
> it, then shouldn't you also consider it the format string?
> 
> I read that thread on the bash-bug list, and the command that was
> being attempted there was
> 
> printf ----%s--- test
> 
> The standards person there said this should be an error, but lets say
> you want that to work, I don't think (unless I misunderstand your
> statement above) that what you're describing will. Won't your way
> print '----%s----' and then use 'test' as the format string? I guess
> that would look like:
> 
> - ---%s--- test
> 
> I don't think that's right no matter how you read the spec.

Not only that but the code Garrett just committed contains a null
pointer dereference in case no arguments are passed to printf.

If you just go ahead and commit stuff while there is still a
discussion going on where people (which do not belong to some
anonymous ksh93 fanboy group) voice legitimate concerns then I
wonder what the point of doing code reviews is?
A real code review would probably have caught trivial errors like
the above.

-- 
Guido Berhoerster



More information about the Developer mailing list