Bug? sprintf(): odd behaviour with mismatched place-holders/lists

Jul 22, 2006 at 10:05am

Bug? sprintf(): odd behaviour with mismatched place-holders/lists

> Summary:
> Provide a descriptive summary of the issue.

If I send sprintf a list of strings longer than the number of
matching “%s” place-holders, I get the first symbol and then the tail
end of the list. The behaviour is different with ints (see below).

> Steps to Reproduce:
> In numbered format, detail the exact steps taken to produce the bug.

Patcher enclosed. Click the message box.

> Expected Results:
> Describe what you expected to happen when you executed the steps
above.

“A.B.C” or “1.2.3″

> Actual Results:
> Please explain what actually occurred when steps above are executed.

“A.D.E” or “3.4.5″

> Regression:
> Describe circumstances where the problem occurs or does not occur,
> such as software versions and/or hardware configurations.

Happens in 4.5.7 and 4.6b11. OS X 4.5.7. TiBook, 1GHz, 768Mb RAM,
dirty screen, dead Firewire port, broken CD drive, ZKM, Karlsruhe,
Germany.

max v2;
#N vpatcher 484 160 697 362;
#P window setfont Monaco 9.;
#P window linecount 1;
#P newex 26 119 40 262153 print;
#P message 26 71 64 262153 A B C D E;
#P newex 26 94 106 262153 sprintf %s.%s.%s;
#P comment 84 121 70 262153 “A.D.E” ?;
#P connect 2 0 1 0;
#P connect 1 0 3 0;
#P pop;

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com

#26881

You must be logged in to reply to this topic.