Fixed get_peer from lua

This commit is contained in:
vysheng 2014-01-17 19:46:33 +00:00
parent 71e5991c59
commit 22a81ff87f

View File

@ -343,7 +343,7 @@ static int pos;
static peer_t *get_peer (const char *s) { static peer_t *get_peer (const char *s) {
int index = 0; 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 ++; index ++;
} }
return index == peer_num ? 0 : Peers[index]; return index == peer_num ? 0 : Peers[index];