aboutsummaryrefslogtreecommitdiff
path: root/crypt.c
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-01-16 18:48:15 +1300
committerTom Ryder <tom@sanctum.geek.nz>2020-01-16 18:48:15 +1300
commitf49416fb25710f6a1c6cb0d927087b2cb5e28305 (patch)
tree2446f91287137200f15d42273d017d755236c2e6 /crypt.c
parentAdjust indentation of switch block (diff)
downloadcrypt-f49416fb25710f6a1c6cb0d927087b2cb5e28305.tar.gz
crypt-f49416fb25710f6a1c6cb0d927087b2cb5e28305.zip
Add braces around single-statement if blocks
Diffstat (limited to 'crypt.c')
-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);