]> diplodocus.org Git - nmh/blobdiff - uip/mkstemp.c
Added warning about when post(1) can't refile(1) a draft.
[nmh] / uip / mkstemp.c
index d594c3621313f3da0ff829c87b7551787c752cf9..ac34c752190fcdd29f1bbd44b7e6bfc4b36f1fdc 100644 (file)
@@ -1,5 +1,4 @@
-/*
- * mkstemp.c -- create a temporary file
+/* mkstemp.c -- create a temporary file
  *
  * This code is Copyright (c) 2014 by the authors of nmh.
  * See the COPYRIGHT file in the root directory of the nmh
@@ -104,15 +103,15 @@ build_template(const char *directory, const char *prefix, const char *suffix) {
         tp += sizeof pattern - 1;
 
         (void) strncpy(tp, suffix, suffix_len);
-        tp += suffix_len;
+        /* tp += suffix_len; */
 
         template[len-1] = '\0';
 
         return template;
-    } else {
-        perror("malloc");
-        return NULL;
     }
+
+    perror("malloc");
+    return NULL;
 }
 
 
@@ -150,7 +149,7 @@ process_args(int argc, char **argv, const char **directory,
     NMH_UNUSED(suffix);
 #   endif /* ! HAVE_MKSTEMPS */
 
-    if (nmh_init(argv[0], 1)) { done(NOTOK); }
+    if (nmh_init(argv[0], 2)) { done(NOTOK); }
     arguments = getarguments (invo_name, argc, argv, 1);
     argp = arguments;
 
@@ -164,7 +163,7 @@ process_args(int argc, char **argv, const char **directory,
                 ambigsw(cp, switches);
                 done(NOTOK);
             case UNKWNSW:
-                advise (NULL, "-%s unknown", cp);
+                inform("-%s unknown", cp);
                 (void) snprintf(buf, sizeof buf, "%s [switches]", invo_name);
                 print_help(buf, switches, 1);
                 done(NOTOK);