From 22a81ff87fb3844548e87323b278cfb427e7e674 Mon Sep 17 00:00:00 2001 From: vysheng Date: Fri, 17 Jan 2014 19:46:33 +0000 Subject: [PATCH] Fixed get_peer from lua --- lua-tg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua-tg.c b/lua-tg.c index 62d9bb7..264d565 100644 --- a/lua-tg.c +++ b/lua-tg.c @@ -343,7 +343,7 @@ static int pos; static peer_t *get_peer (const char *s) { int index = 0; - while (index < peer_num && Peers[index]->print_name && strcmp (Peers[index]->print_name, s)) { + while (index < peer_num && (!Peers[index]->print_name || strcmp (Peers[index]->print_name, s))) { index ++; } return index == peer_num ? 0 : Peers[index];