summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-09-23 10:34:53 +0200
committerantirez <antirez@gmail.com>2015-10-01 13:02:25 +0200
commit97ba4e3886ab2458756d1c67bdc0eb94b85e57a3 (patch)
tree805866688ba315050e5530dffb0d109e0dfb836e /src/util.c
parent36be34bb87f6292b6259172d974c211023e5ba43 (diff)
downloadredis-97ba4e3886ab2458756d1c67bdc0eb94b85e57a3.tar.gz
Lazyfree: Hash converted to use plain SDS WIP 5.
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util.c b/src/util.c
index dba7f20f9..c734b1b6d 100644
--- a/src/util.c
+++ b/src/util.c
@@ -521,12 +521,12 @@ int ld2string(char *buf, size_t len, long double value, int humanfriendly) {
if (l+1 > len) return 0; /* No room. */
/* Now remove trailing zeroes after the '.' */
if (strchr(buf,'.') != NULL) {
- char *p = buf+len-1;
+ char *p = buf+l-1;
while(*p == '0') {
p--;
- len--;
+ l--;
}
- if (*p == '.') len--;
+ if (*p == '.') l--;
}
} else {
l = snprintf(buf,len,"%.17Lg", value);