aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-02-01 01:14:11 +1300
committerTom Ryder <tom@sanctum.geek.nz>2020-02-01 01:14:11 +1300
commite372b4dc1142e70b41d55eb157cc137dfd218373 (patch)
tree30334ea7cc4b7a2bbffc145ebbfc0c3df9ec7d9f
parent0aa5c9ce4a0cbb257bfe176ff6ff73df21fca20b (diff)
downloadcrypt-e372b4dc1142e70b41d55eb157cc137dfd218373.tar.gz
crypt-e372b4dc1142e70b41d55eb157cc137dfd218373.zip
Add const decorators
-rw-r--r--crypt.c8
1 files 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 <string.h> /* strerror(3) */
#include <unistd.h> /* 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);