Index: sdk/crt/stdio/lnx_sprintf.c =================================================================== --- sdk/crt/stdio/lnx_sprintf.c (revision 35630) +++ sdk/crt/stdio/lnx_sprintf.c (working copy) @@ -167,18 +167,16 @@ return 0; c = (type & ZEROPAD) ? '0' : ' '; sign = 0; - if (type & SIGN) { - if (num < 0) { - sign = '-'; - num = -num; - size--; - } else if (type & PLUS) { - sign = '+'; - size--; - } else if (type & SPACE) { - sign = ' '; - size--; - } + if (num < 0) { + sign = '-'; + num = -num; + size--; + } else if (type & PLUS) { + sign = '+'; + size--; + } else if (type & SPACE) { + sign = ' '; + size--; } if (type & SPECIAL) { if (base == 16) @@ -231,10 +229,12 @@ ++buf; } } - while (i < precision--) { - if (buf <= end) - *buf = '0'; - ++buf; + if (type & ZEROPAD) { + while (i < precision--) { + if (buf <= end) + *buf = '0'; + ++buf; + } } while (i-- > 0) { if (buf <= end)