Permalink
Browse files

Fix bug reported by Eric Bergstrome, use %g instead of %lf in

yajl_gen_double.  Thanks Eric!


git-svn-id: http://yajl-c.googlecode.com/svn/trunk@103 e775cfb5-b74b-0410-aad5-5bebe4a96390
  • Loading branch information...
1 parent 8c00428 commit 0dd509105d76b3751ced0bbcdad96101442a6288 llooyd committed May 1, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/yajl_gen.c
View
2 src/yajl_gen.c
@@ -155,7 +155,7 @@ yajl_gen_double(yajl_gen g, double number)
{
char i[32];
ENSURE_VALID_STATE; ENSURE_NOT_KEY; INSERT_SEP; INSERT_WHITESPACE;
- sprintf(i, "%lf", number);
+ sprintf(i, "%g", number);
yajl_buf_append(g->buf, i, strlen(i));
APPENDED_ATOM;
FINAL_NEWLINE;

0 comments on commit 0dd5091

Please sign in to comment.