mirror of
https://github.com/fluencelabs/redis
synced 2025-03-18 16:40:50 +00:00
Fixed dbuf variable scope in luaRedisGenericCommand().
I'm not sure if while the visibility is the inner block, the fact we point to 'dbuf' is a problem or not, probably the stack var isx guaranteed to live until the function returns. However obvious code is better anyway.
This commit is contained in:
parent
3307db49bd
commit
3758f27bc1
@ -232,11 +232,11 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
|
||||
for (j = 0; j < argc; j++) {
|
||||
char *obj_s;
|
||||
size_t obj_len;
|
||||
char dbuf[64];
|
||||
|
||||
if (lua_isnumber(lua,j+1)) {
|
||||
/* We can't use lua_tolstring() for number -> string conversion
|
||||
* since Lua uses a format specifier that loses precision. */
|
||||
char dbuf[64];
|
||||
lua_Number num = lua_tonumber(lua,j+1);
|
||||
|
||||
obj_len = snprintf(dbuf,sizeof(dbuf),"%.17g",(double)num);
|
||||
|
Loading…
x
Reference in New Issue
Block a user