From: Shyouhei Urabe Date: 2011-12-15T11:56:14+09:00 Subject: [ruby-core:41666] [ruby-trunk - Bug #5763] sprintf not throwing error for wrong number of arguments Issue #5763 has been updated by Shyouhei Urabe. Motohiro KOSAKI wrote: > But I can't imagine any useful usecase of current behavior. Then please remember #2709. http://bugs.ruby-lang.org/issues/show/2709 note: I'm neither for nor against it. ---------------------------------------- Bug #5763: sprintf not throwing error for wrong number of arguments http://redmine.ruby-lang.org/issues/5763 Author: NagaChaitanya Vellanki Status: Open Priority: Normal Assignee: Category: core Target version: ruby -v: - sprintf should raise error when the number of arguments does not match the number of format specifiers sprintf with correct number of format specifiers, arguments >> sprintf('%s', 'hello') => "hello" sprintf with a single format specifier and two arguments >> sprintf('%s', 'hello', 'world!') => "hello" sprintf with three format specifiers and two arguments >> sprintf('%s-%s-%s', 'hello', 'world!') ArgumentError: too few arguments from (irb):3:in `sprintf' from (irb):3 from /home/chaitanyav/development/tools_64/bin/irb:12:in `
' -- http://redmine.ruby-lang.org