aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wslua/wslua_proto.c
diff options
context:
space:
mode:
authorHadriel Kaplan <hadriel@128technology.com>2014-12-29 00:21:15 -0500
committerMichael Mann <mmann78@netscape.net>2015-01-04 21:02:38 +0000
commitfac8356610fadf488ff92c5a22e5177bb33a2511 (patch)
treeaf8a1ceec7eb91c5a6a5e6e2ac14621425125e65 /epan/wslua/wslua_proto.c
parent5653fcedca8491829d6d6ce480e7fba13ff801d7 (diff)
Make all Lua code use wmem not emem
Changed all remaining code in wslua that was using emem, to use wmem or simpler methods. Bug: 9927 Change-Id: I3d19a770e0fd77d996bdb6b61a76a722cc2bcd55 Reviewed-on: https://code.wireshark.org/review/6109 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/wslua/wslua_proto.c')
-rw-r--r--epan/wslua/wslua_proto.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/epan/wslua/wslua_proto.c b/epan/wslua/wslua_proto.c
index afa4526bbe..7c24d28313 100644
--- a/epan/wslua/wslua_proto.c
+++ b/epan/wslua/wslua_proto.c
@@ -27,8 +27,6 @@
#include "config.h"
-#include <epan/emem.h>
-
/* WSLUA_MODULE Proto Functions for new protocols and dissectors
The classes and functions in this chapter allow Lua scripts to create new
@@ -1324,12 +1322,13 @@ PROTOFIELD_OTHER(eui64,FT_EUI64)
WSLUA_METAMETHOD ProtoField__tostring(lua_State* L) {
/* Returns a string with info about a protofield (for debugging purposes). */
ProtoField f = checkProtoField(L,1);
- gchar* s = (gchar *)ep_strdup_printf("ProtoField(%i): %s %s %s %s %p %.8x %s",
+ gchar* s = g_strdup_printf("ProtoField(%i): %s %s %s %s %p %.8x %s",
f->hfid,f->name,f->abbr,
ftenum_to_string(f->type),
base_to_string(f->base),
f->vs,f->mask,f->blob);
lua_pushstring(L,s);
+ g_free(s);
return 1;
}
@@ -1584,10 +1583,8 @@ WSLUA_METAMETHOD Proto__call(lua_State* L) { /* Creates a `Proto` object. */
static int Proto__tostring(lua_State* L) {
Proto proto = checkProto(L,1);
- gchar* s;
- s = ep_strdup_printf("Proto: %s",proto->name);
- lua_pushstring(L,s);
+ lua_pushfstring(L, "Proto: %s", proto->name);
return 1;
}