From: Simon Ruderich Date: Tue, 13 May 2014 21:39:30 +0000 (+0200) Subject: move usage display to separate function X-Git-Url: https://ruderich.org/simon/gitweb/?p=wall-notify%2Fwall-notify.git;a=commitdiff_plain;h=ebdd9b1bfc90722e80fcd25f7121888fc57507cf move usage display to separate function --- 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();