diff options
Diffstat (limited to 'epan/wslua/wslua_file.c')
-rw-r--r-- | epan/wslua/wslua_file.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/epan/wslua/wslua_file.c b/epan/wslua/wslua_file.c index 5802a1a447..2c73a8f37a 100644 --- a/epan/wslua/wslua_file.c +++ b/epan/wslua/wslua_file.c @@ -1282,15 +1282,12 @@ static int FrameInfo_set_data (lua_State* L) { if (lua_isstring(L,2)) { size_t len = 0; const gchar* s = luaL_checklstring(L,2,&len); - if (s) { - /* Make sure we have enough room for the packet */ - ws_buffer_assure_space(fi->buf, len); - memcpy(ws_buffer_start_ptr(fi->buf), s, len); - fi->phdr->caplen = (guint32) len; - fi->phdr->len = (guint32) len; - } else { - luaL_error(L, "FrameInfo's attribute 'data' did not get a valid Lua string"); - } + + /* Make sure we have enough room for the packet */ + ws_buffer_assure_space(fi->buf, len); + memcpy(ws_buffer_start_ptr(fi->buf), s, len); + fi->phdr->caplen = (guint32) len; + fi->phdr->len = (guint32) len; } else luaL_error(L, "FrameInfo's attribute 'data' must be a Lua string"); |