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
190b63f9
Unverified
Commit
190b63f9
authored
Mar 14, 2019
by
Salvatore Sanfilippo
Committed by
GitHub
Mar 14, 2019
Browse files
Merge pull request #5812 from guybe7/fix_string2ld
Increase string2ld's buffer size (and fix HINCRBYFLOAT)
parents
01ace0b2
b0c8d6c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/t_hash.c
View file @
190b63f9
...
@@ -615,6 +615,10 @@ void hincrbyfloatCommand(client *c) {
...
@@ -615,6 +615,10 @@ void hincrbyfloatCommand(client *c) {
}
}
value
+=
incr
;
value
+=
incr
;
if
(
isnan
(
value
)
||
isinf
(
value
))
{
addReplyError
(
c
,
"increment would produce NaN or Infinity"
);
return
;
}
char
buf
[
MAX_LONG_DOUBLE_CHARS
];
char
buf
[
MAX_LONG_DOUBLE_CHARS
];
int
len
=
ld2string
(
buf
,
sizeof
(
buf
),
value
,
1
);
int
len
=
ld2string
(
buf
,
sizeof
(
buf
),
value
,
1
);
...
...
src/util.c
View file @
190b63f9
...
@@ -447,7 +447,7 @@ int string2l(const char *s, size_t slen, long *lval) {
...
@@ -447,7 +447,7 @@ int string2l(const char *s, size_t slen, long *lval) {
* a double: no spaces or other characters before or after the string
* a double: no spaces or other characters before or after the string
* representing the number are accepted. */
* representing the number are accepted. */
int
string2ld
(
const
char
*
s
,
size_t
slen
,
long
double
*
dp
)
{
int
string2ld
(
const
char
*
s
,
size_t
slen
,
long
double
*
dp
)
{
char
buf
[
256
];
char
buf
[
MAX_LONG_DOUBLE_CHARS
];
long
double
value
;
long
double
value
;
char
*
eptr
;
char
*
eptr
;
...
...
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