simplify whatnow.c/main() function
[mmh] / uip / mhmisc.c
index 313719f..eb29e83 100644 (file)
@@ -11,6 +11,8 @@
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
+#include <stdarg.h>
+#include <sys/stat.h>
 
 extern int debugsw;
 
@@ -51,7 +53,7 @@ part_ok(CT ct, int sP)
 
        for (ap = parts; *ap; ap++) {
                len = strlen(*ap);
-               if (!strncmp(*ap, ct->c_partno, len) &&
+               if (strncmp(*ap, ct->c_partno, len)==0 &&
                                (!ct->c_partno[len] ||
                                ct->c_partno[len] == '.' ))
                        return 1;
@@ -119,7 +121,7 @@ losing_directory:
 
                        ep = concat("Create directory \"", file, "\"? ", NULL);
                        answer = getanswer(ep);
-                       free(ep);
+                       mh_free0(&ep);
 
                        if (!answer)
                                goto losing_directory;
@@ -235,7 +237,6 @@ flush_errors(void)
        if (errs) {
                fflush(stdout);
                fprintf(stderr, "%s", errs);
-               free(errs);
-               errs = NULL;
+               mh_free0(&errs);
        }
 }