]> diplodocus.org Git - nmh/blobdiff - sbr/m_popen.c
Fix invalid pointer arithmetic.
[nmh] / sbr / m_popen.c
index 611e9c4af422aff9a87d6b09ab4a83c39f07a651..9a1c1a5e447f83a43715e959d6385f9f4befd3d9 100644 (file)
@@ -1,5 +1,4 @@
-/*
- * m_popen.c -- Interface for a popen() call that redirects the current
+/* m_popen.c -- Interface for a popen() call that redirects the current
  *             process standard output to the popen()d process.
  *
  * This code is Copyright (c) 2014, by the authors of nmh.  See the
@@ -9,6 +8,7 @@
 
 #include <h/mh.h>
 #include <h/signals.h>
+#include "m_popen.h"
 
 static int m_pid = NOTOK;      /* Process we're waiting for */
 static  int sd = NOTOK;                /* Original standard output */
@@ -47,7 +47,7 @@ m_popen (char *name, int savestdout)
            execvp (file, arglist);
            fprintf (stderr, "unable to exec ");
            perror (name);
-           _exit (-1);
+           _exit(1);
 
        default: 
            close (pd[0]);