summaryrefslogtreecommitdiffstats
path: root/src/lua.c
diff options
context:
space:
mode:
authormongo <andmarti@gmail.com>2017-04-07 15:07:34 -0300
committermongo <andmarti@gmail.com>2017-04-07 15:07:34 -0300
commit12cab9a7d86cc5fd4dac2b7444f221032f54b485 (patch)
tree8149b3230349df56ca1fe341c09c5d40387751c1 /src/lua.c
parent3ed8056056c571eaef013afc14a1afcbb881b931 (diff)
send command to parser only with send_to_interp function
Diffstat (limited to 'src/lua.c')
-rw-r--r--src/lua.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/lua.c b/src/lua.c
index 4781239..3d24810 100644
--- a/src/lua.c
+++ b/src/lua.c
@@ -115,28 +115,20 @@ static int l_getstr (lua_State *L) {
static int l_setform (lua_State *L) {
int r,c;
char * val;
- //struct ent ** pp;
- //struct ent * p;
- char buf[256];
+ wchar_t buf[BUFFERSIZE];
r = lua_tointeger(L, 1); /* get argument */
c = lua_tointeger(L, 2);
val = (char *) lua_tostring(L,3);
- //sc_debug("setstr !!");
-
- sprintf(buf,"LET %s%d=%s",coltoa(c),r,val);
- send_to_interpp(buf);
-
+ swprintf(buf, FBUFLEN, L"LET %s%d=%s", coltoa(c), r, val);
+ send_to_interp(buf);
return 0;
}
static int l_sc (lua_State *L) {
- char * val;
-
- val=(char *) lua_tostring(L,1);
- //sc_debug("setstr !!");
-
- send_to_interpp(val);
-
+ char * val = (char *) lua_tostring(L,1);
+ wchar_t buf[BUFFERSIZE];
+ swprintf(buf, FBUFLEN, L"%s", val);
+ send_to_interp(buf);
return 0;
}