for (int i = 0; i < data->num; i++) {
int first = MAX(data->entries[i].first, data->firstMessage);
int last = MIN(data->entries[i].last, data->lastMessage);
- if (first <= last)
- data->unread -= last - first + 1;
+ data->unread -= MAX(0, last - first + 1);
}
}
data->group = p_dupstr(line, p - line);
data->nserv = news;
data->deleted = 1;
- if (news->newsgroups->nelem < news->newsgroups->curnelem * 2)
- hash_resize (news->newsgroups, news->newsgroups->nelem * 2);
hash_insert(news->newsgroups, data->group, data);
news->tail = nntp_data_list_append(news->tail, data);
} else {
data->group = m_strdup(buf);
data->nserv = news;
data->deleted = 1;
- if (news->newsgroups->nelem < news->newsgroups->curnelem * 2)
- hash_resize (news->newsgroups, news->newsgroups->nelem * 2);
hash_insert (news->newsgroups, data->group, data);
news->tail = nntp_data_list_append(news->tail, data);
}
nntp_data = nntp_data_new();
nntp_data->group = m_strdup(group);
nntp_data->nserv = s;
- if (s->newsgroups->nelem < s->newsgroups->curnelem * 2)
- hash_resize (s->newsgroups, s->newsgroups->nelem * 2);
hash_insert(s->newsgroups, nntp_data->group, nntp_data);
s->tail = nntp_data_list_append(s->tail, nntp_data);
}
data->group = m_strdup(group);
data->nserv = news;
data->deleted = 1;
- if (news->newsgroups->nelem < news->newsgroups->curnelem * 2)
- hash_resize (news->newsgroups, news->newsgroups->nelem * 2);
hash_insert (news->newsgroups, data->group, data);
news->tail = nntp_data_list_append(news->tail, data);
}