What steps will reproduce the problem?
1. printf("%02d:%02d", 1, 2);
What is the expected output? What do you see instead?
Expected: 01:02
I get 01:0000000000002 (22 digits on the second field)
What version of the product are you using? On what operating system?
2.1 release, BUILTIN_MINI_STDLIB, full source code at
http://bitbucket.org/hudson/magic-lantern/src/tip/picoc/
Please provide any additional information below.
Fix:
@@ -241,6 +241,7 @@
if (*FPos == '%')
{
FPos++;
+ FieldWidth = 0; // fix for %02d:%02d
if (*FPos == '-')
{
/* a leading '-' means left justify */
Original issue reported on code.google.com by broscuta...@gmail.com on 14 Jan 2013 at 2:45
Original issue reported on code.google.com by
broscuta...@gmail.com
on 14 Jan 2013 at 2:45