Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joebarker87/0b695c3e85e07ea3caa6d707c2f3a991 to your computer and use it in GitHub Desktop.
Save joebarker87/0b695c3e85e07ea3caa6d707c2f3a991 to your computer and use it in GitHub Desktop.
From 94982258fe0dced4a041c6abdc6cdef5d3ce7526 Mon Sep 17 00:00:00 2001
From: Joseph Barker <joseph.barker@imr.tohoku.ac.jp>
Date: Tue, 19 Sep 2017 14:10:12 +0900
Subject: [PATCH] revert regression in printing of exponentials
---
lib/libconfig.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/libconfig.c b/lib/libconfig.c
index 47920ec..24aad95 100644
--- a/lib/libconfig.c
+++ b/lib/libconfig.c
@@ -222,7 +222,7 @@ static void __config_write_value(const config_t *config,
{
char *q;
- snprintf(fbuf, sizeof(fbuf) - 3, "%.*f",
+ snprintf(fbuf, sizeof(fbuf) - 3, "%.*g",
TAB2DIGITS(config->tab_width), /* XXX: hack; See config_set_float_precision */
value->fval
);
--
2.14.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment