home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / iso9660 / mail / pine / c_client.arc / bezerk.diff < prev    next >
Encoding:
Text File  |  1993-07-31  |  2.1 KB  |  49 lines

  1. *** bezerk.c.old    Fri Dec  4 16:22:20 1992
  2. --- bezerk.c    Fri Dec  4 22:51:12 1992
  3. ***************
  4. *** 1281,1290 ****
  5.       if (e) j = (e - s) - 1;    /* calculate message length */
  6.       else j = strlen (s) - 1;/* otherwise is remainder of data */
  7.       if (m) {        /* new cache needed, have previous data? */
  8. !       n->header = (char *) fs_get (sizeof (FILECACHE) + j);
  9.         n = (FILECACHE *) n->header;
  10.       }
  11. !     else m = n = (FILECACHE *) fs_get (sizeof (FILECACHE) + j);
  12.                   /* copy message data */
  13.       strncpy (n->internal,s,j);
  14.       n->internal[j] = '\0';
  15. --- 1281,1290 ----
  16.       if (e) j = (e - s) - 1;    /* calculate message length */
  17.       else j = strlen (s) - 1;/* otherwise is remainder of data */
  18.       if (m) {        /* new cache needed, have previous data? */
  19. !       n->header = (char *) fs_get (sizeof (FILECACHE) + j + 1);
  20.         n = (FILECACHE *) n->header;
  21.       }
  22. !     else m = n = (FILECACHE *) fs_get (sizeof (FILECACHE) + j + 1);
  23.                   /* copy message data */
  24.       strncpy (n->internal,s,j);
  25.       n->internal[j] = '\0';
  26. ***************
  27. *** 1328,1334 ****
  28.     for (i = stream->nmsgs, n = m; i < nmsgs; i++) {
  29.       LOCAL->msgs[i] = m = n;    /* set cache, and next cache pointer */
  30.       n = (FILECACHE *) n->header;
  31. !     if (!((s = m->internal) && VALID)) fatal ("Bogus entry in new cache list");
  32.       m->header = s = ++t;    /* pointer to message header */
  33.       m->headersize -= m->header - m->internal;
  34.       m->body = NIL;        /* assume no body as yet */
  35. --- 1328,1340 ----
  36.     for (i = stream->nmsgs, n = m; i < nmsgs; i++) {
  37.       LOCAL->msgs[i] = m = n;    /* set cache, and next cache pointer */
  38.       n = (FILECACHE *) n->header;
  39. !     /* This is a bugtrap for bogons in the new message cache, which may happen
  40. !      * if memory is corrupted.  Note that in the case of a totally empty
  41. !      * message, a newline is appended and counts adjusted.
  42. !      */
  43. !     if ((!((s = m->internal) && VALID)) &&
  44. !     !(s && !strchr (s,'\n') && strcat (s,"\n") && VALID &&
  45. !       m->headersize++)) fatal ("Bogus entry in new cache list");
  46.       m->header = s = ++t;    /* pointer to message header */
  47.       m->headersize -= m->header - m->internal;
  48.       m->body = NIL;        /* assume no body as yet */
  49.