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:
parent
3e98eb2de0
commit
dbffb91706
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue