diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-07-20 17:27:36 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-07-21 00:28:18 +0000 |
commit | 3beab65515ab693806a7b64665bfd287133e860e (patch) | |
tree | 8c6aa291589c54f2f2f96a7dca4bcb5c4518fcdd /epan/wslua | |
parent | be1398c17ca1d5b203a930d9254125d602830aef (diff) |
No need to check for string option values being null.
A string option, if present, always has a value; it might be a null
*string*, but you won't get a null pointer (if the option isn't present,
it simply isn't present).
Fix some comments while we're at it.
Change-Id: I9c1420f56998a7d04de5c5cc2e92631b181f303a
Reviewed-on: https://code.wireshark.org/review/16564
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/wslua.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/wslua/wslua.h b/epan/wslua/wslua.h index 333c179687..335adbb887 100644 --- a/epan/wslua/wslua.h +++ b/epan/wslua/wslua.h @@ -558,7 +558,7 @@ extern int wslua_set__index(lua_State *L); char* str; \ if ((obj->member) && (obj->member->len > 0)) { \ if (wtap_block_get_string_option_value(g_array_index(obj->member, wtap_block_t, 0), option, &str) == WTAP_OPTTYPE_SUCCESS) { \ - lua_pushstring(L,str); /* this pushes nil if obj->member is null */ \ + lua_pushstring(L,str); \ } \ } \ }) @@ -572,7 +572,7 @@ extern int wslua_set__index(lua_State *L); char* str; \ if ((obj->member) && (obj->member->len > 0)) { \ if (wtap_block_get_nth_string_option_value(g_array_index(obj->member, wtap_block_t, 0), option, 0, &str) == WTAP_OPTTYPE_SUCCESS) { \ - lua_pushstring(L,str); /* this pushes nil if obj->member is null */ \ + lua_pushstring(L,str); \ } \ } \ }) |