Commit 22a81ff8 authored by vysheng's avatar vysheng

Fixed get_peer from lua

parent 71e5991c
...@@ -343,7 +343,7 @@ static int pos; ...@@ -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];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment