From d9e9fb8ccfa208052b89aee8cfd3fc6c38752b96 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Wed, 14 May 2014 01:04:56 +0200 Subject: [PATCH] cleanup argv passing to notification program --- src/wall-notify.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wall-notify.c b/src/wall-notify.c index 24afb7a..7fb3b33 100644 --- a/src/wall-notify.c +++ b/src/wall-notify.c @@ -205,9 +205,6 @@ static void pass_buffer_to_program(const char *buffer, size_t length, char **arg pid_t pid; - /* Skip argv[0]. */ - argv++; - if (pipe(fds) != 0) { perror("pipe"); return; @@ -303,9 +300,14 @@ static void usage(const char *argv0) { int main(int argc, char **argv) { int ptm, pts; char *name; + const char *argv0; + + argv0 = argv[0]; + /* Don't pass our argv[0] to the notification program. */ + argv++; if (argc < 2) { - usage(argv[0]); + usage(argv0); } ptm = open_tty(); -- 2.45.2