Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/zbxtypes.h5
-rw-r--r--src/libs/zbxdbhigh/db.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/include/zbxtypes.h b/include/zbxtypes.h
index cc014f90407..73129c3ab89 100644
--- a/include/zbxtypes.h
+++ b/include/zbxtypes.h
@@ -159,8 +159,9 @@ typedef off_t zbx_offset_t;
#endif /* _WINDOWS */
-#define ZBX_FS_DBL "%lf"
-#define ZBX_FS_DBL_EXT(p) "%." #p "lf"
+#define ZBX_FS_ARG_LIST(m, a) m(a)
+#define ZBX_FS_DBL_EXT(p) "%." #p "g"
+#define ZBX_FS_DBL ZBX_FS_ARG_LIST(ZBX_FS_DBL_EXT, DECIMAL_DIG)
#define ZBX_PTR_SIZE sizeof(void *)
#define ZBX_FS_SIZE_T ZBX_FS_UI64
diff --git a/src/libs/zbxdbhigh/db.c b/src/libs/zbxdbhigh/db.c
index 4dd5e699bf0..eec13ca6bd4 100644
--- a/src/libs/zbxdbhigh/db.c
+++ b/src/libs/zbxdbhigh/db.c
@@ -2604,7 +2604,7 @@ retry_oracle:
zbx_snprintf_alloc(&sql, &sql_alloc, &sql_offset, "%d", value->i32);
break;
case ZBX_TYPE_FLOAT:
- zbx_snprintf_alloc(&sql, &sql_alloc, &sql_offset, "%.*g", DECIMAL_DIG, value->dbl);
+ zbx_snprintf_alloc(&sql, &sql_alloc, &sql_offset, ZBX_FS_DBL, value->dbl);
break;
case ZBX_TYPE_UINT:
zbx_snprintf_alloc(&sql, &sql_alloc, &sql_offset, ZBX_FS_UI64,