about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pipeto.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pipeto.c b/pipeto.c
index 77982e1..8014584 100644
--- a/pipeto.c
+++ b/pipeto.c
@@ -51,7 +51,10 @@ pipeto(const char *cmdline)
 		}
 		argv[argc] = 0;
 
-		execvp(argv[0], argv);
+		if (argv[0])
+			execvp(argv[0], argv);
+		else
+			errno = EINVAL;
 
 		// execvp failed, write errno to parent
 		long e = errno;