From: Simon Ruderich Date: Tue, 13 May 2014 23:04:56 +0000 (+0200) Subject: cleanup argv passing to notification program X-Git-Url: https://ruderich.org/simon/gitweb/?p=wall-notify%2Fwall-notify.git;a=commitdiff_plain;h=d9e9fb8ccfa208052b89aee8cfd3fc6c38752b96 cleanup argv passing to notification program --- 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();