1
0
Fork 0
forked from len0rd/rockbox

Oops, our snprintf doesn't support some fancy features so use something that works instead :)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17187 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nils Wallménius 2008-04-20 14:07:21 +00:00
parent 3e98eb2de0
commit dbffb91706

View file

@ -826,6 +826,7 @@ int talk_value_decimal(long n, int unit, int decimals, bool enqueue)
};
char tbuf[8];
char fmt[] = "%0nd";
if (talk_temp_disable_count > 0)
return -1; /* talking has been disabled */
@ -865,7 +866,9 @@ int talk_value_decimal(long n, int unit, int decimals, bool enqueue)
n = -n;
}
snprintf(tbuf, sizeof(tbuf), "%0*d", decimals, n % pow10[decimals]);
fmt[2] = '0' + decimals;
snprintf(tbuf, sizeof(tbuf), fmt, n % pow10[decimals]);
talk_fractional(tbuf, n / pow10[decimals], unit_id);
return 0;