Skip to content

Commit

Permalink
修复几处小BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyoo812 committed Oct 25, 2023
1 parent 8a9be57 commit 3c50f66
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion extend/lcodec/src/mysql.h
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ namespace lcodec {
void encode_args_value(lua_State* L, int index) {
switch (lua_type(L, index)) {
case LUA_TBOOLEAN:
m_buf->write<double>(lua_tointeger(L, index));
m_buf->write<uint8_t>(lua_toboolean(L, index) ? 1 : 0);
break;
case LUA_TNUMBER:
lua_isinteger(L, index) ? m_buf->write<uint64_t>(lua_tointeger(L, index)) : m_buf->write<double>(lua_tonumber(L, index));
Expand Down
2 changes: 1 addition & 1 deletion extend/lcodec/src/redis.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ namespace lcodec {
string_encode(L, idx);
break;
case LUA_TBOOLEAN:
integer_encode(lua_tointeger(L, idx));
integer_encode(lua_toboolean(L, idx) ? 1 : 0);
break;
case LUA_TNUMBER:
lua_isinteger(L, idx) ? integer_encode(lua_tointeger(L, idx)) : number_encode(lua_tonumber(L, idx));
Expand Down
2 changes: 1 addition & 1 deletion extend/lualog/lualog/lualog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace logger {
case LUA_TUSERDATA: return "userdata";
case LUA_TLIGHTUSERDATA: return "userdata";
case LUA_TSTRING: return lua_tostring(L, index);
case LUA_TBOOLEAN: return (lua_tointeger(L, index) == 1) ? "true" : "false";
case LUA_TBOOLEAN: return lua_toboolean(L, index) ? "true" : "false";
case LUA_TTABLE:
if ((flag & 0x01) == 0x01) {
buf.clean();
Expand Down

0 comments on commit 3c50f66

Please sign in to comment.