X-Git-Url: https://git.llucax.com/software/mutt-debian.git/blobdiff_plain/19304f7c526fbe36ba0db2fb80bcaf3bd974d81d..92a950882661a15ea3bd1e73be4e1a341d81e9b9:/parse.c diff --git a/parse.c b/parse.c index 143a62e..cba9662 100644 --- a/parse.c +++ b/parse.c @@ -614,8 +614,8 @@ BODY *mutt_parse_multipart (FILE *fp, const char *boundary, LOFF_T end_off, int #ifdef SUN_ATTACHMENT if (mutt_get_parameter ("content-lines", new->parameter)) { - for (lines = atoi(mutt_get_parameter ("content-lines", new->parameter)); - lines; lines-- ) + mutt_atoi (mutt_get_parameter ("content-lines", new->parameter), &lines); + for ( ; lines; lines-- ) if (ftello (fp) >= end_off || fgets (buffer, LONG_STRING, fp) == NULL) break; } @@ -773,9 +773,8 @@ time_t mutt_parse_date (const char *s, HEADER *h) switch (count) { case 0: /* day of the month */ - if (!isdigit ((unsigned char) *t)) + if (mutt_atoi (t, &tm.tm_mday) < 0 || tm.tm_mday < 0) return (-1); - tm.tm_mday = atoi (t); if (tm.tm_mday > 31) return (-1); break; @@ -787,7 +786,8 @@ time_t mutt_parse_date (const char *s, HEADER *h) break; case 2: /* year */ - tm.tm_year = atoi (t); + if (mutt_atoi (t, &tm.tm_year) < 0 || tm.tm_year < 0) + return (-1); if (tm.tm_year < 50) tm.tm_year += 100; else if (tm.tm_year >= 1900) @@ -1022,7 +1022,7 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short { if (hdr) { - if ((hdr->content->length = atoi (p)) < 0) + if ((hdr->content->length = atol (p)) < 0) hdr->content->length = -1; } matched = 1; @@ -1083,13 +1083,11 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short { if (hdr) { - hdr->lines = atoi (p); - /* * HACK - mutt has, for a very short time, produced negative * Lines header values. Ignore them. */ - if (hdr->lines < 0) + if (mutt_atoi (p, &hdr->lines) < 0 || hdr->lines < 0) hdr->lines = 0; }