diff options
author | Nils Wallménius <nils@rockbox.org> | 2008-04-20 14:07:21 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2008-04-20 14:07:21 +0000 |
commit | dbffb91706dd6ed13e49f3f17cce1f379e2da7e9 (patch) | |
tree | e7b06cae6ab1a296e5152fae3ae1b6564f097f76 /apps | |
parent | 3e98eb2de0d533e401ad07ed5b0e13cd973a5af3 (diff) | |
download | rockbox-dbffb91706dd6ed13e49f3f17cce1f379e2da7e9.tar.gz rockbox-dbffb91706dd6ed13e49f3f17cce1f379e2da7e9.zip |
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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/talk.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/talk.c b/apps/talk.c index e9d54fdd31..0635e506fe 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -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; |