]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
message date parser: Fixed parsing last optional fields due to previous rfc822 parser...
authorTimo Sirainen <tss@iki.fi>
Sun, 7 Sep 2008 17:03:00 +0000 (20:03 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 7 Sep 2008 17:03:00 +0000 (20:03 +0300)
--HG--
branch : HEAD

src/lib-mail/message-date.c

index cb0227ae31273fd292b5c64d3ab074116a42adda..490c0e32099c64e983abaf91d6d5b5601fad2e2e 100644 (file)
@@ -98,7 +98,8 @@ static int next_token(struct message_date_parser_context *ctx,
        int ret;
 
        str_truncate(ctx->str, 0);
-       ret = rfc822_parse_atom(&ctx->parser, ctx->str);
+       ret = ctx->parser.data == ctx->parser.end ? 0 :
+               rfc822_parse_atom(&ctx->parser, ctx->str);
 
        *value = str_data(ctx->str);
        *value_len = str_len(ctx->str);