p_delete(&pop_data->timestamp);
if ((p = strchr(buf, '<')) && (q = strchr(p, '>'))) {
- pop_data->timestamp = p_dupstr(p, q - p);
+ pop_data->timestamp = p_dupstr(p, q + 1 - p);
}
return PQ_OK;
}
pop_data_t *pop_data;
ssize_t plen;
- if (!PopHost) {
+ if (m_strisempty(PopHost)) {
mutt_error _("POP host is not defined.");
return;
}
plen = m_strlen(PopHost) + 7;
- url = p = p_new(char, plen);
+ url = p = p_new(char, plen);
if (url_check_scheme (PopHost) == U_UNKNOWN) {
- plen -= m_strcpy(url, plen, "pop://");
- p += plen;
+ snprintf(p, plen, "pop://%s", PopHost);
+ } else {
+ m_strcpy(p, plen, PopHost);
}
- m_strcpy(p, plen, PopHost);
ret = pop_parse_path (url, &act);
p_delete(&url);