From: Tiberius Date: 2006-07-29T04:40:05+09:00 Subject: Re: Bug in ruby printf/sprintf The equivalent C program under RedHat Linux 3 update 6 x86_64 produces | test| Also, I ran your ruby code in ruby 1.8.4 (2006-12-24) and it also produces the same results as the C code does. paul.dlug@gmail.com wrote: > I have encountered what appears to be a bug in ruby's printf/sprintf > > This code: > > str = "test" > printf "|%010s|", str > > Generates this output: > | test| > > However in C and perl, the same code generates this output: > |000000test| > > The latter output is correct according to the man pages, according to > the ruby doc for printf/sprintf the behavior should be the same. > > Has anyone else encountered this? Is there something I'm missing here > or is there a workaround for it if it is a bug? > > > Thanks, > Paul