Actions
Bug #13315
closedSingle "%" at the end of `printf` format string appears in the result
Bug #13315:
Single "%" at the end of `printf` format string appears in the result
Description
Actions
Added by nobu (Nobuyoshi Nakada) over 9 years ago. Updated about 9 years ago.
Description
I believe this is not intentional, so created a pull-request on GitHub.
https://github.com/ruby/ruby/pull/1560
This change makes ruby raise error for printf("%") though C just shows warning because this change will drop displayed "%" silently for developers if this shows just warning instead of raising error.
I updated rubyspec too.
https://github.com/ruby/spec/issues/401
Matz, is this intentional?
When I wrote the original code, it was intentional, but without any specific reason.
It's OK for me to raise an error for this case.
Matz.
Applied in changeset trunk|r58890.
Raise ArgumentError if sprintf format string ends with %