~ubuntu-dev/ubuntu/lucid/mutt/lucid-201002110857

« back to all changes in this revision

Viewing changes to parse.c

  • Committer: Bazaar Package Importer
  • Author(s): أحمد المحمودي (Ahmed El-Mahmoudy)
  • Date: 2009-06-17 17:17:28 UTC
  • mfrom: (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20090617171728-61dkl7w5fgn7ybdq
Tags: upstream-1.5.20
Import upstream version 1.5.20

Show diffs side-by-side

added added

removed removed

Lines of Context:
614
614
 
615
615
#ifdef SUN_ATTACHMENT
616
616
        if (mutt_get_parameter ("content-lines", new->parameter)) {
617
 
          for (lines = atoi(mutt_get_parameter ("content-lines", new->parameter));
618
 
               lines; lines-- )
 
617
          mutt_atoi (mutt_get_parameter ("content-lines", new->parameter), &lines);
 
618
          for ( ; lines; lines-- )
619
619
             if (ftello (fp) >= end_off || fgets (buffer, LONG_STRING, fp) == NULL)
620
620
               break;
621
621
        }
773
773
    switch (count)
774
774
    {
775
775
      case 0: /* day of the month */
776
 
        if (!isdigit ((unsigned char) *t))
 
776
        if (mutt_atoi (t, &tm.tm_mday) < 0 || tm.tm_mday < 0)
777
777
          return (-1);
778
 
        tm.tm_mday = atoi (t);
779
778
        if (tm.tm_mday > 31)
780
779
          return (-1);
781
780
        break;
787
786
        break;
788
787
 
789
788
      case 2: /* year */
790
 
        tm.tm_year = atoi (t);
 
789
        if (mutt_atoi (t, &tm.tm_year) < 0 || tm.tm_year < 0)
 
790
          return (-1);
791
791
        if (tm.tm_year < 50)
792
792
          tm.tm_year += 100;
793
793
        else if (tm.tm_year >= 1900)
1022
1022
      {
1023
1023
        if (hdr)
1024
1024
        {
1025
 
          if ((hdr->content->length = atoi (p)) < 0)
 
1025
          if ((hdr->content->length = atol (p)) < 0)
1026
1026
            hdr->content->length = -1;
1027
1027
        }
1028
1028
        matched = 1;
1083
1083
    {
1084
1084
      if (hdr)
1085
1085
      {
1086
 
        hdr->lines = atoi (p);
1087
 
 
1088
1086
        /* 
1089
1087
         * HACK - mutt has, for a very short time, produced negative
1090
1088
         * Lines header values.  Ignore them. 
1091
1089
         */
1092
 
        if (hdr->lines < 0)
 
1090
        if (mutt_atoi (p, &hdr->lines) < 0 || hdr->lines < 0)
1093
1091
          hdr->lines = 0;
1094
1092
      }
1095
1093