From e372b4dc1142e70b41d55eb157cc137dfd218373 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 1 Feb 2020 01:14:11 +1300 Subject: Add const decorators --- crypt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crypt.c b/crypt.c index 4c9f0fb..3ebcbb3 100644 --- a/crypt.c +++ b/crypt.c @@ -5,12 +5,12 @@ #include /* strerror(3) */ #include /* crypt(3) */ -void error(char *); +void error(const char *); void usage(FILE *, int); int main (int argc, char **argv) { - char *hash, *key, *salt; + const char *hash, *key, *salt; int opt; while ((opt = getopt(argc, argv, "h")) != -1) { @@ -52,7 +52,7 @@ int main (int argc, char **argv) /* * Exit with error error message */ -void error(char *message) +void error(const char *message) { fprintf(stderr, "%s\n", message); exit(EXIT_FAILURE); @@ -61,7 +61,7 @@ void error(char *message) /* * Show usage to given stream, and exit with given code */ -void usage(FILE *stream, int status) +void usage(FILE *stream, const int status) { fputs("USAGE: crypt [-h | KEY SALT]\n", stream); exit(status); -- cgit v1.2.3