aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crypt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypt.c b/crypt.c
index e704cfa..457a245 100644
--- a/crypt.c
+++ b/crypt.c
@@ -22,8 +22,9 @@ int main (int argc, char **argv)
* If we don't have three arguments left after processing the options,
* exit with usage information and error status
*/
- if (argc != 3)
+ if (argc != 3) {
usage(stderr, EXIT_FAILURE);
+ }
key = argv[1];
salt = argv[2];
@@ -32,8 +33,9 @@ int main (int argc, char **argv)
* Create the hash, but exit immediately with the system error string
* if it returns a null pointer (error condition)
*/
- if (!(hash = crypt(key, salt)))
+ if (!(hash = crypt(key, salt))) {
error(strerror(errno));
+ }
puts(hash);
exit(EXIT_SUCCESS);