Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
parsers:json: Use %g on snprintf
Browse files Browse the repository at this point in the history
Function that converts double to string.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
  • Loading branch information
ceolin committed Sep 25, 2015
1 parent 32d2089 commit 5e634cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/parsers/sol-json.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ sol_json_double_to_str(const double value, char *buf, size_t len)

SOL_NULL_CHECK(buf, -EINVAL);

ret = snprintf(buf, len, "%f", value);
ret = snprintf(buf, len, "%g", value);
if (ret < 0 || ret > (int)len)
return -ENOMEM;

Expand Down

0 comments on commit 5e634cc

Please sign in to comment.