webmcp
changeset 546:d5bad374641e
Fixed wrong use of logical-or operator introduced in previous commits
author | jbe |
---|---|
date | Sat Oct 19 20:23:28 2019 +0200 (2019-10-19) |
parents | 80c16991a770 |
children | 75fd8869bc4e |
files | libraries/mondelefant/mondelefant_native.c |
line diff
1.1 --- a/libraries/mondelefant/mondelefant_native.c Sat Oct 19 20:09:41 2019 +0200 1.2 +++ b/libraries/mondelefant/mondelefant_native.c Sat Oct 19 20:23:28 2019 +0200 1.3 @@ -1783,7 +1783,7 @@ 1.4 if (!lua_isnil(L, 6)) { 1.5 // special handling of 1:1 references (primary side): 1.6 lua_getfield(L, 6, "mode"); // 7 1.7 - if (!strcmp(lua_tostring(L, 7) || "", "11")) { 1.8 + if (lua_isstring(L, 7) && !strcmp(lua_tostring(L, 7), "11")) { 1.9 lua_getfield(L, 6, "primary"); // 8 1.10 if (lua_toboolean(L, 8)) { 1.11 if (!lua_isnil(L, 3)) { 1.12 @@ -1806,7 +1806,7 @@ 1.13 lua_settop(L, 6); 1.14 // special handling of 1:1 references (secondary side): 1.15 lua_getfield(L, 6, "mode"); // 7 1.16 - if (!strcmp(lua_tostring(L, 7) || "", "11")) { 1.17 + if (lua_isstring(L, 7) && !strcmp(lua_tostring(L, 7), "11")) { 1.18 lua_settop(L, 6); 1.19 if (!lua_isnil(L, 3)) { 1.20 // store object in other _ref table (use false for nil): // TODO: use special object instead of false