diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2014-10-12 22:27:54 +0200 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2014-10-13 19:06:40 +0000 |
commit | b653564fe21c84482d99586b437be1ffcb35459a (patch) | |
tree | 4cc26824d0f23c777a64d267988bb2c1440a66f0 /epan/wslua/wslua_struct.c | |
parent | 9ce5ca581d30074c2c02eca0f51dbe840bf9411b (diff) |
Lua: luaL_checkstring does not return NULL
Removed all checks for NULL strings to cleanup the code.
Change-Id: Ia890cd9b206296f586e85214f07765f14984580b
Reviewed-on: https://code.wireshark.org/review/4632
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'epan/wslua/wslua_struct.c')
-rw-r--r-- | epan/wslua/wslua_struct.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/epan/wslua/wslua_struct.c b/epan/wslua/wslua_struct.c index 06e5c203c7..db7e957a9c 100644 --- a/epan/wslua/wslua_struct.c +++ b/epan/wslua/wslua_struct.c @@ -622,11 +622,6 @@ WSLUA_CONSTRUCTOR Struct_tohex (lua_State *L) { just not fromhex. In fact, we should accept/coerce a Int64/UInt64 here too someday. */ s = luaL_checklstring(L, WSLUA_ARG_Struct_tohex_BYTESTRING, &len); - if (!s) { - WSLUA_ARG_ERROR(Struct_tohex,BYTESTRING,"must be a Lua string"); - return 0; - } - lowercase = wslua_optbool(L,WSLUA_OPTARG_Struct_tohex_LOWERCASE,FALSE); sep = luaL_optstring(L,WSLUA_OPTARG_Struct_tohex_SEPARATOR,NULL); @@ -645,11 +640,6 @@ WSLUA_CONSTRUCTOR Struct_fromhex (lua_State *L) { /* luaL_checklstring coerces the argument to a string, and we don't want to do that */ s = wslua_checklstring_only(L, WSLUA_ARG_Struct_fromhex_HEXBYTES, &len); - if (!s) { - WSLUA_ARG_ERROR(Struct_fromhex,HEXBYTES,"must be a Lua string"); - return 0; - } - sep = luaL_optstring(L,WSLUA_OPTARG_Struct_fromhex_SEPARATOR,NULL); wslua_hex2bin(L, s, (guint)len, sep); |