From e927a246108e78dfaf6e02d604a674234e5116d3 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 16 May 2011 18:36:07 +0200 Subject: [PATCH] Fix for wrong error level detection in redis.log() --- src/scripting.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripting.c b/src/scripting.c index 2f94f4d7..be6247a9 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -209,11 +209,11 @@ int luaLogCommand(lua_State *lua) { luaPushError(lua, "redis.log() requires two arguments or more."); return 1; } else if (!lua_isnumber(lua,-argc)) { - luaPushError(lua, "First argument must be a number."); + luaPushError(lua, "First argument must be a number (log level)."); return 1; } level = lua_tonumber(lua,-argc); - if (level < REDIS_DEBUG && level > REDIS_WARNING) { + if (level < REDIS_DEBUG || level > REDIS_WARNING) { luaPushError(lua, "Invalid debug level."); return 1; } -- 2.47.2