]> diplodocus.org Git - nmh/blobdiff - uip/inc.c
Add EndsWithC(char *s, int c) and call it in some initial places.
[nmh] / uip / inc.c
index 8a71eb22aab4ccd0eaa8c55c295401643efd3fe9..62c56eb17f5ef749df7f807190aae405f9ac5b8c 100644 (file)
--- a/uip/inc.c
+++ b/uip/inc.c
@@ -634,12 +634,14 @@ go_to_it:
 
            msgnum++;
            if (packfile) {
 
            msgnum++;
            if (packfile) {
+                size_t len;
+
                fseek (pf, 0L, SEEK_CUR);
                pos = ftell (pf);
                size = 0;
                fseek (pf, 0L, SEEK_CUR);
                pos = ftell (pf);
                size = 0;
-               if (fwrite (mmdlm1, 1, strlen (mmdlm1), pf) < strlen (mmdlm1)) {
+                len = strlen(mmdlm1);
+               if (fwrite(mmdlm1, 1, len, pf) < len)
                    advise (mmdlm1, "fwrite");
                    advise (mmdlm1, "fwrite");
-               }
                start = ftell (pf);
 
                if (pop_retr (i, pop_pack) == NOTOK)
                start = ftell (pf);
 
                if (pop_retr (i, pop_pack) == NOTOK)
@@ -651,7 +653,7 @@ go_to_it:
                    adios (packfile, "write error on");
                fseek (pf, start, SEEK_SET);
            } else {
                    adios (packfile, "write error on");
                fseek (pf, start, SEEK_SET);
            } else {
-               cp = getcpy (m_name (msgnum));
+               cp = mh_xstrdup(m_name (msgnum));
                if ((pf = fopen (cp, "w+")) == NULL)
                    adios (cp, "unable to write");
                chmod (cp, m_gmprot ());
                if ((pf = fopen (cp, "w+")) == NULL)
                    adios (cp, "unable to write");
                chmod (cp, m_gmprot ());
@@ -693,10 +695,12 @@ go_to_it:
            charstring_free (scanl);
 
            if (packfile) {
            charstring_free (scanl);
 
            if (packfile) {
+                size_t len;
+
                fseek (pf, stop, SEEK_SET);
                fseek (pf, stop, SEEK_SET);
-               if (fwrite (mmdlm2, 1, strlen (mmdlm2), pf) < strlen (mmdlm1)) {
+                len = strlen(mmdlm2);
+               if (fwrite(mmdlm2, 1, len, pf) < len)
                    advise (mmdlm2, "fwrite");
                    advise (mmdlm2, "fwrite");
-               }
                if (fflush (pf) || ferror (pf)) {
                    int e = errno;
                    pop_quit ();
                if (fflush (pf) || ferror (pf)) {
                    int e = errno;
                    pop_quit ();
@@ -796,7 +800,7 @@ go_to_it:
            msgnum++;
 
            sp = Maildir[i].filename;
            msgnum++;
 
            sp = Maildir[i].filename;
-           cp = getcpy (m_name (msgnum));
+           cp = mh_xstrdup(m_name (msgnum));
            pf = NULL;
            if (!trnflag || link(sp, cp) == -1) {
                static char buf[65536];
            pf = NULL;
            if (!trnflag || link(sp, cp) == -1) {
                static char buf[65536];