Changeset 557:2c8523f9a1c8 for buffy.c

Show
Ignore:
Timestamp:
1998-11-10 14:14:00 (10 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Introduce or rewrite mutt_{str*cmp,strlen} and use them all over the
place. If there are still segmentation faults due to missing
NONULLs over, they are gone now.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • buffy.c

    r553 r557  
    6565  { 
    6666    /* we save in the buffer at the end the first 7 chars from the last read */ 
    67     strncpy (buffer + BUFSIZ, buffer, 5+2); /* 2 == 2 * strlen(CRLF) */ 
     67    strncpy (buffer + BUFSIZ, buffer, 5+2); /* 2 == 2 * mutt_strlen(CRLF) */ 
    6868    fseek (f, pos, SEEK_SET); 
    6969    bytes_read = fread (buffer, sizeof (char), bytes_read, f); 
     
    7171      return -1; 
    7272    for (i = bytes_read; --i >= 0;) 
    73       if (!strncmp (buffer + i, "\n\nFrom ", strlen ("\n\nFrom "))) 
     73      if (!mutt_strncmp (buffer + i, "\n\nFrom ", mutt_strlen ("\n\nFrom "))) 
    7474      {                         /* found it - go to the beginning of the From */ 
    7575        fseek (f, pos + i + 2, SEEK_SET); 
     
    8080 
    8181  /* here we are at the beginning of the file */ 
    82   if (!strncmp ("From ", buffer, 5)) 
     82  if (!mutt_strncmp ("From ", buffer, 5)) 
    8383  { 
    8484    fseek (f, 0, 0); 
     
    178178    for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next)) 
    179179    { 
    180       if (strcmp (buf, (*tmp)->path) == 0) 
     180      if (mutt_strcmp (buf, (*tmp)->path) == 0) 
    181181        break; 
    182182    } 
     
    414414    while (count < 3) 
    415415    { 
    416       if (strcmp (s, tmp->path) == 0) 
     416      if (mutt_strcmp (s, tmp->path) == 0) 
    417417        count++; 
    418418      else if (count && tmp->new)