summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xplist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xplist.c b/src/xplist.c
index 263d88e..2eaba55 100644
--- a/src/xplist.c
+++ b/src/xplist.c
@@ -113,7 +113,7 @@ static size_t dtostr(char *buf, size_t bufsize, double realval)
113 } else { 113 } else {
114 size_t i = 0; 114 size_t i = 0;
115 len = snprintf(buf, bufsize, "%.*g", 17, realval); 115 len = snprintf(buf, bufsize, "%.*g", 17, realval);
116 for (i = 0; i < len; i++) { 116 for (i = 0; buf && i < len; i++) {
117 if (buf[i] == ',') { 117 if (buf[i] == ',') {
118 buf[i] = '.'; 118 buf[i] = '.';
119 break; 119 break;
@@ -479,7 +479,7 @@ static void node_estimate_size(node_t *node, uint64_t *size, uint32_t depth)
479 *size += (XPLIST_INT_LEN << 1) + 6; 479 *size += (XPLIST_INT_LEN << 1) + 6;
480 break; 480 break;
481 case PLIST_REAL: 481 case PLIST_REAL:
482 *size += num_digits_i((int64_t)data->realval) + 7; 482 *size += dtostr(NULL, 0, data->realval);
483 *size += (XPLIST_REAL_LEN << 1) + 6; 483 *size += (XPLIST_REAL_LEN << 1) + 6;
484 break; 484 break;
485 case PLIST_DATE: 485 case PLIST_DATE: