]> diplodocus.org Git - nmh/blobdiff - uip/mkstemp.c
test/inc/test-eom-align: Fix tests; they've never worked.
[nmh] / uip / mkstemp.c
index 259c3edd39de5b4c28e841de477fb4c6f93a7058..b7acbb1460051c7ed103d8c55006ea3f16de2642 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
 #endif /* HAVE_CONFIG_H */
 #include <unistd.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <string.h>
 #include <stdio.h>
 
+#include <h/utils.h>
+
 #if ! defined HAVE_MKSTEMPS
 #   define HAVE_MKSTEMPS 0
 #endif /* ! HAVE_MKSTEMPS */
@@ -109,10 +111,10 @@ build_template(const char *directory, const char *prefix, const char *suffix) {
         template[len-1] = '\0';
 
         return template;
-    } else {
-        perror("malloc");
-        return NULL;
     }
+
+    perror("malloc");
+    return NULL;
 }
 
 
@@ -164,7 +166,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);