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_util.c | |
parent | 9ce5ca581d30074c2c02eca0f51dbe840bf9411b (diff) | |
download | wireshark-b653564fe21c84482d99586b437be1ffcb35459a.tar.gz |
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_util.c')
-rw-r--r-- | epan/wslua/wslua_util.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/epan/wslua/wslua_util.c b/epan/wslua/wslua_util.c index ea53e6b542..d9c2766fdc 100644 --- a/epan/wslua/wslua_util.c +++ b/epan/wslua/wslua_util.c @@ -207,16 +207,9 @@ WSLUA_FUNCTION wslua_dofile(lua_State* L) { in the current directory it will look for it in wireshark's user and system directories. */ #define WSLUA_ARG_dofile_FILENAME 1 /* Name of the file to be run. */ const char *given_fname = luaL_checkstring(L, WSLUA_ARG_dofile_FILENAME); - char* filename; + char* filename = wslua_get_actual_filename(given_fname); int n; - if (!given_fname) { - WSLUA_ARG_ERROR(dofile,FILENAME,"must be a string"); - return 0; - } - - filename = wslua_get_actual_filename(given_fname); - if (!filename) { WSLUA_ARG_ERROR(dofile,FILENAME,"file does not exist"); return 0; |