/* Defaults */
acct->flags = 0;
acct->type = M_ACCT_TYPE_POP;
+ acct->port = 0;
c = safe_strdup (path);
url_parse_ciss (&url, c);
acct->flags |= M_ACCT_SSL;
service = getservbyname (url.scheme == U_POP ? "pop3" : "pop3s", "tcp");
- if (service)
- acct->port = ntohs (service->s_port);
- else
- acct->port = url.scheme == U_POP ? POP_PORT : POP_SSL_PORT;;
+ if (!acct->port) {
+ if (service)
+ acct->port = ntohs (service->s_port);
+ else
+ acct->port = url.scheme == U_POP ? POP_PORT : POP_SSL_PORT;;
+ }
FREE (&c);
return 0;
strfcpy (inbuf + lenbuf, p, sizeof (buf));
pos += chunk;
- if (chunk >= sizeof (buf))
+ /* cast is safe since we break out of the loop when chunk<=0 */
+ if ((size_t)chunk >= sizeof (buf))
{
lenbuf += strlen (p);
}