* uip/mhlistsbr.c, uip/mhlsbr.c, uip/picksbr.c: cast
[mmh] / uip / replsbr.c
index d92fade..a415346 100644 (file)
@@ -79,7 +79,8 @@ replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen,
     register char **ap;
     register struct comp **savecomp;
     int        char_read = 0, format_len, mask;
-    char name[NAMESZ], *scanl, *cp;
+    char name[NAMESZ], *scanl;
+    unsigned char *cp;
     FILE *out;
 
     mask = umask(~m_gmprot());
@@ -159,10 +160,12 @@ replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen,
                 */
                if ((cptr = wantcomp[CHASH(name)]))
                    do {
-                       if (!strcasecmp(name, cptr->c_name)) {
+                       if (!mh_strcasecmp(name, cptr->c_name)) {
                            char_read += msg_count;
                            if (! cptr->c_text) {
-                               cptr->c_text = tmpbuf;
+                               i = strlen(cptr->c_text = tmpbuf) - 1;
+                               if (tmpbuf[i] == '\n')
+                                   tmpbuf[i] = '\0';
                                *--savecomp = cptr;
                                tmpbuf = *nxtbuf++;
                            } else {
@@ -291,11 +294,9 @@ static unsigned int bufsiz=0;      /* current size of buf */
                int i = dst - buf;\
                int n = last_dst - buf;\
                bufsiz += ((dst + len - bufend) / BUFINCR + 1) * BUFINCR;\
-               buf = realloc (buf, bufsiz);\
+               buf = mh_xrealloc (buf, bufsiz);\
                dst = buf + i;\
                last_dst = buf + n;\
-               if (! buf)\
-                   adios (NULL, "formataddr: couldn't get buffer space");\
                bufend = buf + bufsiz;\
            }
 
@@ -391,8 +392,8 @@ insert (struct mailname *np)
        return 0;
 
     for (mp = &mq; mp->m_next; mp = mp->m_next) {
-       if (!strcasecmp (np->m_host, mp->m_next->m_host)
-               && !strcasecmp (np->m_mbox, mp->m_next->m_mbox))
+       if (!mh_strcasecmp (np->m_host, mp->m_next->m_host)
+               && !mh_strcasecmp (np->m_mbox, mp->m_next->m_mbox))
            return 0;
     }
     if (!ccme && ismymbox (np))