-/* $OpenBSD: cmd-find.c,v 1.2 2015/04/27 22:42:10 nicm Exp $ */
+/* $OpenBSD: cmd-find.c,v 1.3 2015/04/27 22:58:58 nicm Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@users.sourceforge.net>
c = NULL;
if (clist != NULL) {
for (i = 0; i < csize; i++) {
+ if (clist[i]->session == NULL)
+ continue;
if (cmd_find_client_better(clist[i], c))
c = clist[i];
}
} else {
TAILQ_FOREACH(c_loop, &clients, entry) {
+ if (c_loop->session == NULL)
+ continue;
if (cmd_find_client_better(c_loop, c))
c = c_loop;
}