Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
8beec4f0
Commit
8beec4f0
authored
Nov 05, 2019
by
Guy Benoish
Browse files
Make sure Redis does not reply with negative zero
parent
a15a5d70
Changes
2
Show whitespace changes
Inline
Side-by-side
src/util.c
View file @
8beec4f0
...
...
@@ -560,6 +560,10 @@ int ld2string(char *buf, size_t len, long double value, ld2string_mode mode) {
}
if
(
*
p
==
'.'
)
l
--
;
}
if
(
l
==
2
&&
buf
[
0
]
==
'-'
&&
buf
[
1
]
==
'0'
)
{
buf
[
0
]
=
'0'
;
l
=
1
;
}
break
;
default:
return
0
;
/* Invalid mode. */
}
...
...
tests/unit/type/incr.tcl
View file @
8beec4f0
...
...
@@ -151,4 +151,10 @@ start_server {tags {"incr"}} {
catch
{
r incrbyfloat foo 1
}
err
format $err
}
{
ERR*valid*
}
test
{
No negative zero
}
{
r incrbyfloat foo
[
expr double
(
1
)
/41
]
r incrbyfloat foo
[
expr double
(
-1
)
/41
]
r get foo
}
{
0
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment