Fixed get_peer from lua
This commit is contained in:
parent
71e5991c59
commit
22a81ff87f
2
lua-tg.c
2
lua-tg.c
@ -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];
|
||||||
|
Loading…
Reference in New Issue
Block a user