author | Myhailo Danylenko <isbear@ukrpost.net> |
Fri, 01 Jul 2011 19:46:30 +0300 | |
changeset 37 | 6e425a8e245e |
parent 36 | 41df6f2a7aa8 |
child 38 | 34a2b880615c |
lm_message.c | file | annotate | diff | comparison | revisions |
--- a/lm_message.c Sun Jun 26 19:59:28 2011 +0300 +++ b/lm_message.c Fri Jul 01 19:46:30 2011 +0300 @@ -177,14 +177,15 @@ static int create_lm_message (lua_State *L) { const char *mtype; - const char *st; + const char *st = NULL; const char *to = NULL; LmMessage *message; luaL_checktype (L, 1, LUA_TTABLE); lua_getfield (L, 1, "mtype"); mtype = lua_tostring (L, -1); - st = strchr (mtype, '-'); + if (mtype) + st = strchr (mtype, '-'); lua_getfield (L, 1, "to"); if (lua_type (L, -1) == LUA_TSTRING)