From fedaf696fec64e6934f006f36d60a6fa25ccb90e Mon Sep 17 00:00:00 2001 From: root Date: Wed, 27 Dec 2017 10:55:46 +0800 Subject: [PATCH] if the aVal is empty, the is a bug --- LuaXML_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LuaXML_lib.c b/LuaXML_lib.c index 25c3784..0de5038 100644 --- a/LuaXML_lib.c +++ b/LuaXML_lib.c @@ -319,7 +319,7 @@ int Xml_eval(lua_State *L) { if(token[sepPos]) { // regular attribute const char* aVal =token+sepPos+2; lua_pushlstring(L, token, sepPos); - Xml_pushDecode(L, aVal, strlen(aVal)-1); + Xml_pushDecode(L, aVal, strlen(aVal) ? strlen(aVal)-1 : 0); lua_settable(L, -3); } }