From 22b3ae927520be81a1b42a626837fec3a1238917 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Sun, 5 Jun 2011 17:42:10 +0100 Subject: [PATCH] Fix tpt.get_name and limit tpt.log message length --- src/luaconsole.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/luaconsole.c b/src/luaconsole.c index 8fd137bb7..0109f9f47 100644 --- a/src/luaconsole.c +++ b/src/luaconsole.c @@ -205,7 +205,7 @@ int luatpt_log(lua_State* l) { char *buffer; buffer = luaL_optstring(l, 1, ""); - strcpy(console_error, buffer); + strncpy(console_error, buffer, 254); return 0; } @@ -626,10 +626,10 @@ int luatpt_textwidth(lua_State* l) int luatpt_get_name(lua_State* l) { if (svf_login){ - lua_pushstring(l, ""); + lua_pushstring(l, svf_user); return 1; } - lua_pushstring(l, svf_user); + lua_pushstring(l, ""); return 1; }