diff options
author | Kevin McCarthy <kevin@8t8.us> | 2020-12-21 15:34:58 -0800 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2020-12-22 18:12:24 -0800 |
commit | 03e17ef7f70279d36f95083fcb952b9f386256f7 (patch) | |
tree | 8f18998004beba815a280cb41db2edf1ab9c3cf9 /imap/message.c | |
parent | a4a2a1ed7abf02507a35e2a6d49da102cbd117dd (diff) |
Correct length to use LOFF_T.
This is a part two, made in master, to the stable branch commit
11b18027. These are mostly length adjustments to use LOFF_T, matching the
BODY->length type.
An argument could be made for size_t instead, and a few places in Mutt
do assign between those types. I've used LOFF_T because off_t is a
signed integer. Some changes in this commit affect loops that
decrement a length pointer while > 0. Switching to a size_t could
create a wraparound infinite loop bug.
This also changes the Content-Length header parser to use atoll()
intead of atol(). I noticed from the man page that atol() doesn't
seem to return -1 on error. But I've kept the check anyway.
Diffstat (limited to 'imap/message.c')
-rw-r--r-- | imap/message.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/imap/message.c b/imap/message.c index f064ad43..48853b4f 100644 --- a/imap/message.c +++ b/imap/message.c @@ -1235,7 +1235,7 @@ parsemsg: fgets (buf, sizeof (buf), msg->fp); } - h->content->length = ftell (msg->fp) - h->content->offset; + h->content->length = ftello (msg->fp) - h->content->offset; } /* This needs to be done in case this is a multipart message */ |