while (mutt_socket_readchar(conn, &ch) == 1) {
if (ch == '\n') {
- if (buf->data[buf->len - 1] == '\r') {
+ if (buf->len && buf->data[buf->len - 1] == '\r') {
buf->data[--buf->len] = '\0';
}
return 0;
if (Tunnel && *Tunnel)
mutt_tunnel_socket_setup (conn);
- else if (account->flags & M_ACCT_SSL) {
+ else if (account->has_ssl) {
if (mutt_ssl_socket_setup (conn) < 0) {
mutt_socket_free (conn);
return NULL;