From: Timo Sirainen Date: Tue, 31 Mar 2009 23:09:08 +0000 (-0400) Subject: Minor code cleanup. X-Git-Tag: 2.0.alpha1~1038^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2a5404c1f5726b0912f4ec7dc763262f2aabd2d7;p=thirdparty%2Fdovecot%2Fcore.git Minor code cleanup. --HG-- branch : HEAD --- diff --git a/src/lib-mail/message-size.c b/src/lib-mail/message-size.c index d559d609ad..26ce237d37 100644 --- a/src/lib-mail/message-size.c +++ b/src/lib-mail/message-size.c @@ -10,7 +10,7 @@ int message_get_header_size(struct istream *input, struct message_size *hdr, { const unsigned char *msg; size_t i, size, startpos, missing_cr_count; - int ret = 0; + int ret; memset(hdr, 0, sizeof(struct message_size)); if (has_nuls != NULL) @@ -55,8 +55,7 @@ int message_get_header_size(struct istream *input, struct message_size *hdr, hdr->physical_size += i - startpos; } - if (input->stream_errno != 0) - ret = -1; + ret = input->stream_errno != 0 ? -1 : 0; i_stream_skip(input, startpos); hdr->physical_size += startpos; @@ -71,7 +70,7 @@ int message_get_body_size(struct istream *input, struct message_size *body, const unsigned char *msg; size_t i, size, missing_cr_count; bool last_cr; - int ret = 0; + int ret; memset(body, 0, sizeof(struct message_size)); if (has_nuls != NULL) @@ -109,8 +108,7 @@ int message_get_body_size(struct istream *input, struct message_size *body, body->physical_size += i - 1; } while (i_stream_read_data(input, &msg, &size, 1) > 0); - if (input->stream_errno != 0) - ret = -1; + ret = input->stream_errno != 0 ? -1 : 0; i_stream_skip(input, 1); body->physical_size++;