From 779aebc91cd8d3043ab172e0bc5b8c988df88e33 Mon Sep 17 00:00:00 2001 From: Oran Agra Date: Sun, 3 Nov 2019 16:42:31 +0200 Subject: Module API for loading and saving long double looks like each platform implements long double differently (different bit count) so we can't save them as binary, and we also want to avoid creating a new RDB format version, so we save these are hex strings using "%La". This commit includes a change in the arguments of ld2string to support this. as well as tests for coverage and short reads. coded by @guybe7 --- src/object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/object.c') diff --git a/src/object.c b/src/object.c index 70022f897..53ad518a9 100644 --- a/src/object.c +++ b/src/object.c @@ -178,7 +178,7 @@ robj *createStringObjectFromLongLongForValue(long long value) { * The 'humanfriendly' option is used for INCRBYFLOAT and HINCRBYFLOAT. */ robj *createStringObjectFromLongDouble(long double value, int humanfriendly) { char buf[MAX_LONG_DOUBLE_CHARS]; - int len = ld2string(buf,sizeof(buf),value,humanfriendly); + int len = ld2string(buf,sizeof(buf),value,humanfriendly? LD_STR_HUMAN: LD_STR_AUTO); return createStringObject(buf,len); } -- cgit v1.2.1