Mercurial > dovecot > core-2.2
changeset 22170:293249bf0b5a
lib-mail: message_address_parse() - Remove unnecessary NULL checks
message_address_parse() always initialized rfc822_parser_init() with
last_comment string.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Wed, 07 Jun 2017 13:34:39 +0300 |
parents | 1c7f10f84fa2 |
children | 7bb6969f1f08 |
files | src/lib-mail/message-address.c |
diffstat | 1 files changed, 3 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-mail/message-address.c Wed Jun 07 13:19:40 2017 +0300 +++ b/src/lib-mail/message-address.c Wed Jun 07 13:34:39 2017 +0300 @@ -204,8 +204,7 @@ /* addr-spec = local-part "@" domain */ int ret, ret2; - if (ctx->parser.last_comment != NULL) - str_truncate(ctx->parser.last_comment, 0); + str_truncate(ctx->parser.last_comment, 0); ret = parse_local_part(ctx); if (ret <= 0) { @@ -218,12 +217,8 @@ ret = ret2; } - if (ctx->parser.last_comment != NULL) { - if (str_len(ctx->parser.last_comment) > 0) { - ctx->addr.name = - p_strdup(ctx->pool, str_c(ctx->parser.last_comment)); - } - } + if (str_len(ctx->parser.last_comment) > 0) + ctx->addr.name = p_strdup(ctx->pool, str_c(ctx->parser.last_comment)); return ret; }