aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--imap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/imap.c b/imap.c
index 1f62f696..ed5ca59d 100644
--- a/imap.c
+++ b/imap.c
@@ -1038,7 +1038,7 @@ static int imap_fetch_body(int sock, struct query *ctl, int number, int *lenp)
if ((cp = strchr(buf, '{'))) {
errno = 0;
*lenp = (int)strtol(cp + 1, (char **)NULL, 10);
- if (errno == ERANGE && (*lenp == LONG_MAX || *lenp == LONG_MIN))
+ if (errno == ERANGE || *lenp < 0)
*lenp = -1; /* length is too big/small for us to handle */
}
else