summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-lex.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-09-01 17:23:40 +0200
committerRobin Watts <robin.watts@artifex.com>2014-09-02 10:16:36 +0100
commit7e274313904e46cd3cf3f476ceb888ca687d1969 (patch)
treeeec0d597d3d63c75648f328a2f3de49dfd074b7b /source/pdf/pdf-lex.c
parentdcac166e4a6af00ae18852a1cca002ae0b5dd818 (diff)
downloadmupdf-7e274313904e46cd3cf3f476ceb888ca687d1969.tar.xz
Add fz_snprintf and use it for formatting floating point numbers.
Diffstat (limited to 'source/pdf/pdf-lex.c')
-rw-r--r--source/pdf/pdf-lex.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/source/pdf/pdf-lex.c b/source/pdf/pdf-lex.c
index b019b7b2..6a4033f9 100644
--- a/source/pdf/pdf-lex.c
+++ b/source/pdf/pdf-lex.c
@@ -606,11 +606,7 @@ void pdf_print_token(fz_context *ctx, fz_buffer *fzbuf, int tok, pdf_lexbuf *buf
break;
case PDF_TOK_REAL:
{
- char sbuf[256];
- sprintf(sbuf, "%g", buf->f);
- if (strchr(sbuf, 'e')) /* bad news! */
- sprintf(sbuf, fabsf(buf->f) > 1 ? "%1.1f" : "%1.8f", buf->f);
- fz_buffer_printf(ctx, fzbuf, "%s", sbuf);
+ fz_buffer_printf(ctx, fzbuf, "%g", buf->f);
}
break;
default: