diff --git a/src/script_lua.c b/src/script_lua.c index c8e6a1283..578a22067 100644 --- a/src/script_lua.c +++ b/src/script_lua.c @@ -653,7 +653,7 @@ static void luaReplyToRedisReply(client *c, client* script_client, lua_State *lu if (t == LUA_TSTRING) { sds ok = sdsnew(lua_tostring(lua,-1)); sdsmapchars(ok,"\r\n"," ",2); - addReplySds(c,sdscatprintf(sdsempty(),"+%s\r\n",ok)); + addReplyStatusLength(c, ok, sdslen(ok)); sdsfree(ok); lua_pop(lua,2); return; diff --git a/src/server.h b/src/server.h index 9dfbf81b7..105b2db4e 100644 --- a/src/server.h +++ b/src/server.h @@ -2507,6 +2507,7 @@ void addReplyBulkCString(client *c, const char *s); void addReplyBulkCBuffer(client *c, const void *p, size_t len); void addReplyBulkLongLong(client *c, long long ll); void addReply(client *c, robj *obj); +void addReplyStatusLength(client *c, const char *s, size_t len); void addReplySds(client *c, sds s); void addReplyBulkSds(client *c, sds s); void setDeferredReplyBulkSds(client *c, void *node, sds s);