#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;
}
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;
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)
{
if (hdr)
{
- if ((hdr->content->length = atoi (p)) < 0)
+ if ((hdr->content->length = atol (p)) < 0)
hdr->content->length = -1;
}
matched = 1;
{
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;
}