]> diplodocus.org Git - nmh/blobdiff - uip/forw.c
expect this commit to be force-replaced periodically
[nmh] / uip / forw.c
index a79fcc0537c44505fc981fb0a2555b01a57274c3..9af71e78b266199e5a74fc1c895e13a3d7b980cb 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "whatnowproc.h"
 #include "sbr/m_name.h"
 #include "sbr/m_gmprot.h"
 #include "sbr/getarguments.h"
@@ -338,14 +339,15 @@ main (int argc, char **argv)
 try_it_again:
 
     strncpy (drft, buildsw ? m_maildir ("draft")
-                         : m_draft (dfolder, NULL, NOUSE, &isdf), sizeof(drft));
+                 : m_draft (dfolder, NULL, NOUSE, &isdf), sizeof(drft) - 1);
 
+    // TODO(epg): Duplicated from comp.
     /* Check if a draft already exists */
     if (!buildsw && stat (drft, &st) != NOTOK) {
        printf ("Draft \"%s\" exists (%ld bytes).", drft, (long) st.st_size);
        for (i = LISTDSW; i != YESW;) {
-           if (!(argp = read_switch_multiword ("\nDisposition? ",
-                                               isdf ? aqrnl : aqrl)))
+            char *const *const words = read_switch_multiword ("\nDisposition? ", isdf ? aqrnl : aqrl);
+           if (words == NULL)
                done (1);
            switch (i = smatch (*argp, isdf ? aqrnl : aqrl)) {
                case NOSW: 
@@ -440,8 +442,8 @@ try_it_again:
        if (!form)
            form = digestcomps;
     } else {
-       if (!form)
-           form = forwcomps;
+       if (!form)
+           form = forwcomps;
     }
 
     dat[0] = digest ? issue : msgnum;
@@ -452,7 +454,7 @@ try_it_again:
 
 
     in = build_form (form, digest, dat, from, to, cc, fcc, subject,
-                    file ? file : fwdmsg);
+                    file ? file : fwdmsg);
 
     if ((out = creat (drft, m_gmprot ())) == NOTOK)
        adios (drft, "unable to create");