From 5a1102ccceac1346500afd740296b2d6f95f0f97 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 16 Jan 2020 18:58:04 +1300 Subject: Reorder functions --- crypt.c | 16 ++++++++-------- crypt.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crypt.c b/crypt.c index 457a245..7ba42ef 100644 --- a/crypt.c +++ b/crypt.c @@ -42,19 +42,19 @@ int main (int argc, char **argv) } /* - * Show usage to given stream, and exit with given code + * Exit with error error message */ -void usage(FILE *stream, int status) +void error(char *message) { - fputs("USAGE: crypt [-h | KEY SALT]\n", stream); - exit(status); + fprintf(stderr, "%s\n", message); + exit(EXIT_FAILURE); } /* - * Exit with error error message + * Show usage to given stream, and exit with given code */ -void error(char *message) +void usage(FILE *stream, int status) { - fprintf(stderr, "%s\n", message); - exit(EXIT_FAILURE); + fputs("USAGE: crypt [-h | KEY SALT]\n", stream); + exit(status); } diff --git a/crypt.h b/crypt.h index 6612e01..0a25c0d 100644 --- a/crypt.h +++ b/crypt.h @@ -5,5 +5,5 @@ #include /* strerror(3) */ #include /* crypt(3) */ -void usage(FILE *, int); void error(char *); +void usage(FILE *, int); -- cgit v1.2.3