Fix some possible null-deref warnings

This commit is contained in:
TingPing 2014-12-31 11:12:43 -05:00
parent c5016e390f
commit 112632bb4e
2 changed files with 2 additions and 2 deletions

View File

@ -220,7 +220,7 @@ find_channel (server *serv, char *chan)
while (list) while (list)
{ {
sess = list->data; sess = list->data;
if ((!serv || serv == sess->server) && sess->type == SESS_CHANNEL) if ((serv == sess->server) && sess->type == SESS_CHANNEL)
{ {
if (!serv->p_cmp (chan, sess->channel)) if (!serv->p_cmp (chan, sess->channel))
return sess; return sess;

View File

@ -1311,7 +1311,7 @@ cmd_menu (struct session *sess, char *tbuf, char *word[], char *word_eol[])
if (markup) if (markup)
{ {
char *p; /* to force pango closing tags through */ char *p; /* to force pango closing tags through */
for (p = label; *p; p++) for (p = label; p && *p; p++)
if (*p == 3) if (*p == 3)
*p = '/'; *p = '/';
} }