if (rfc822_skip_lwsp(&ctx.parser) <= 0) {
/* no addresses */
- return NULL;
+ } else {
+ (void)parse_address_list(&ctx, max_addresses);
}
- (void)parse_address_list(&ctx, max_addresses);
return ctx.first_addr;
}
{
struct rfc822_parser_context parser;
int ret;
+ bool success = FALSE;
rfc822_parser_init(&parser, (const unsigned char *)*msgid_p,
strlen(*msgid_p), NULL);
ret = rfc822_parse_quoted_string(&parser, msgid);
else
ret = rfc822_parse_dot_atom(&parser, msgid);
- if (ret <= 0)
- return FALSE;
-
- if (*parser.data != '@')
- return FALSE;
- str_append_c(msgid, '@');
- parser.data++;
- rfc822_skip_lwsp(&parser);
-
- if (rfc822_parse_dot_atom(&parser, msgid) <= 0)
- return FALSE;
-
- if (*parser.data != '>')
- return FALSE;
-
- *msgid_p = (const char *)parser.data + 1;
- return TRUE;
+ if (ret > 0 && *parser.data == '@') {
+ str_append_c(msgid, '@');
+ parser.data++;
+ rfc822_skip_lwsp(&parser);
+
+ if (rfc822_parse_dot_atom(&parser, msgid) > 0 &&
+ *parser.data == '>') {
+ *msgid_p = (const char *)parser.data + 1;
+ success = TRUE;
+ }
+ }
+ return success;
}
static void strip_lwsp(char *str)
ctx->part->flags |= MESSAGE_PART_FLAG_MULTIPART_DIGEST;
}
- if (ret < 0)
- return;
- if ((ctx->part->flags & MESSAGE_PART_FLAG_MULTIPART) == 0 ||
+ if (ret < 0 ||
+ (ctx->part->flags & MESSAGE_PART_FLAG_MULTIPART) == 0 ||
ctx->last_boundary != NULL)
return;