From ebdd9b1bfc90722e80fcd25f7121888fc57507cf Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 13 May 2014 23:39:30 +0200 Subject: [PATCH] move usage display to separate function --- src/wall-notify.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/wall-notify.c b/src/wall-notify.c index dd37e89..24afb7a 100644 --- a/src/wall-notify.c +++ b/src/wall-notify.c @@ -294,14 +294,18 @@ static void handle_wall(int fd, char **argv) { } } +static void usage(const char *argv0) { + fprintf(stderr, "usage: %s \n", argv0); + exit(EXIT_FAILURE); +} + int main(int argc, char **argv) { int ptm, pts; char *name; if (argc < 2) { - fprintf(stderr, "usage: %s \n", argv[0]); - exit(EXIT_FAILURE); + usage(argv[0]); } ptm = open_tty(); -- 2.45.2