Lazyfree: Hash converted to use plain SDS WIP 5.

This commit is contained in:
antirez
2015-09-23 10:34:53 +02:00
parent 36be34bb87
commit 97ba4e3886
3 changed files with 30 additions and 34 deletions

View File

@ -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);