Commit 751c8698 authored by antirez's avatar antirez
Browse files

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.
parent b7172077
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment