]> diplodocus.org Git - nmh/blobdiff - uip/ap.c
lock_file.c: close(2) file descriptor on failure, avoiding leak.
[nmh] / uip / ap.c
index a20747f9014121f52c191fa38bccc8114c08cb0d..8265723e8c981581aa1f9e702a5e0b28e81a9dec 100644 (file)
--- a/uip/ap.c
+++ b/uip/ap.c
@@ -10,7 +10,7 @@
 #include <h/fmt_scan.h>
 #include <h/mts.h>
 #include <h/utils.h>
-#include "../sbr/terminal.h"
+#include "sbr/terminal.h"
 
 #define        NADDRS  100
 
@@ -128,7 +128,7 @@ main (int argc, char **argv)
        status += process (addrs[addrp], width);
 
     fmt_free (fmt, 1);
-    done(min(status, MAX_EXIT));
+    done(!!status);
     return 1;
 }
 
@@ -171,13 +171,13 @@ process (char *arg, int length)
 
        cptr = fmt_findcomp ("text");
        if (cptr) {
-            mh_xfree(cptr->c_text);
+            free(cptr->c_text);
            cptr->c_text = p->pq_text;
            p->pq_text = NULL;
        }
        cptr = fmt_findcomp ("error");
        if (cptr) {
-            mh_xfree(cptr->c_text);
+            free(cptr->c_text);
            cptr->c_text = p->pq_error;
            p->pq_error = NULL;
        }
@@ -186,8 +186,8 @@ process (char *arg, int length)
        fputs (charstring_buffer (scanl), stdout);
        charstring_free (scanl);
 
-        mh_xfree(p->pq_text);
-        mh_xfree(p->pq_error);
+        free(p->pq_text);
+        free(p->pq_error);
        q = p->pq_next;
        free(p);
     }