[#636] doc/NEWS — Matt Armstrong <matt@...>

22 messages 2002/12/15

Error in sprintf.c?

From: Alexander Bokovoy <a.bokovoy@...>
Date: 2002-12-19 11:25:01 UTC
List: ruby-core #662
Greetings!

It seems that there is a bug in recent sprintf changes which presents at least in 
a snapshot of Ruby 1.7.3 dated 2002-11-17:

$ irb
irb(main):001:0> sprintf("%*s", 10, "hello")
"     hello"
irb(main):002:0> sprintf("%*1$s", 10, "hello")
ArgumentError: unnumbered(1) mixed with numbered
	from (irb):2:in `sprintf'
        from (irb):2
irb(main):003:0> sprintf("%*2$s", "hello", 10)
ArgumentError: unnumbered(1) mixed with numbered
        from (irb):3:in `sprintf'
        from (irb):3

-- 
/ Alexander Bokovoy
---
Familiarity breeds contempt -- and children.
		-- Mark Twain

In This Thread

Prev Next