summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-08-28 22:42:04 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2010-08-28 22:42:04 +0300
commitf8f17dc3083536dee2ea16e1d3ce1ee8cf0d2045 (patch)
treec68bdb130a9fc2a203d32bfc441573f94e42a9e4
parenteea4191dbfe090237da49c01fb3b9924a1216621 (diff)
downloadmailutils-f8f17dc3083536dee2ea16e1d3ce1ee8cf0d2045.tar.gz
mailutils-f8f17dc3083536dee2ea16e1d3ce1ee8cf0d2045.tar.bz2
Fix mime test.
* mailbox/mime.c (mu_mime_get_part): Fix the end limit for the part's abridgement. * mailbox/streamref.c (_streamref_seek): Fix ESPIPE condition.
-rw-r--r--mailbox/mime.c2
-rw-r--r--mailbox/streamref.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/mailbox/mime.c b/mailbox/mime.c
index f6f6d75e0..1345ea4ab 100644
--- a/mailbox/mime.c
+++ b/mailbox/mime.c
@@ -887,7 +887,7 @@ mu_mime_get_part (mu_mime_t mime, size_t part, mu_message_t *msg)
ret = mu_streamref_create_abridged (&stream, mime->stream,
mime_part->offset,
mime_part->offset +
- mime_part->len);
+ mime_part->len - 1);
if (ret == 0)
{
mu_stream_set_flags (stream,
diff --git a/mailbox/streamref.c b/mailbox/streamref.c
index 4949a8540..dad96c6dc 100644
--- a/mailbox/streamref.c
+++ b/mailbox/streamref.c
@@ -169,7 +169,7 @@ _streamref_seek (struct _mu_stream *str, mu_off_t off, mu_off_t *ppos)
size -= sp->start;
}
- if (off < 0 || off >= size)
+ if (off < 0 || off > size)
return sp->stream.last_err = ESPIPE;
rc = mu_stream_seek (sp->transport, sp->start + off, MU_SEEK_SET,
&sp->offset);

Return to:

Send suggestions and report system problems to the System administrator.