aboutsummaryrefslogtreecommitdiff
path: root/midend.c
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2017-08-17 15:27:52 -0400
committerFranklin Wei <franklin@rockbox.org>2020-12-07 19:27:19 -0500
commitb1f691f2deb0b59c6e237241e1995c5d95f37ffa (patch)
tree499df3c5baf7fbb9943909f0eb4d48db386b444c /midend.c
parentb4b86bbdbeb99c9fd9cfa6b61454047eb5e8fe20 (diff)
downloadpuzzles-b1f691f2deb0b59c6e237241e1995c5d95f37ffa.zip
puzzles-b1f691f2deb0b59c6e237241e1995c5d95f37ffa.tar.gz
puzzles-b1f691f2deb0b59c6e237241e1995c5d95f37ffa.tar.bz2
puzzles-b1f691f2deb0b59c6e237241e1995c5d95f37ffa.tar.xz
Introduce ftoa() as a replacement for the %g format specifier
Not all platforms support printing floats, this is a more portable (if uglier) way.
Diffstat (limited to 'midend.c')
-rw-r--r--midend.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/midend.c b/midend.c
index 15636d4..f2d27d3 100644
--- a/midend.c
+++ b/midend.c
@@ -2049,7 +2049,7 @@ void midend_serialise(midend *me,
*/
if (me->ourgame->is_timed) {
char buf[80];
- sprintf(buf, "%g", me->elapsed);
+ ftoa(buf, me->elapsed);
wr("TIME", buf);
}