aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crypt.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/crypt.c b/crypt.c
index 22f82bd..29c4794 100644
--- a/crypt.c
+++ b/crypt.c
@@ -5,40 +5,40 @@
*/
int main (int argc, char **argv)
{
- /* The hash we will produce, hopefully */
- char *hash = NULL;
+ /* The hash we will produce, hopefully */
+ char *hash = NULL;
- /* Option character */
- int opt;
+ /* Option character */
+ int opt;
- /* Iterate through any options */
- while ((opt = getopt(argc, argv, "h")) != -1) {
- switch (opt) {
- case 'h':
- usage(stdout, EXIT_SUCCESS);
- break;
- case '?':
- usage(stderr, EXIT_FAILURE);
- break;
- default:
- abort();
- }
- }
+ /* Iterate through any options */
+ while ((opt = getopt(argc, argv, "h")) != -1) {
+ switch (opt) {
+ case 'h':
+ usage(stdout, EXIT_SUCCESS);
+ break;
+ case '?':
+ usage(stderr, EXIT_FAILURE);
+ break;
+ default:
+ abort();
+ }
+ }
- /* If we don't have three arguments left now, bail */
- if (argc != 3)
- usage(stderr, EXIT_FAILURE);
+ /* If we don't have three arguments left now, bail */
+ if (argc != 3)
+ usage(stderr, EXIT_FAILURE);
- /* All seems well, build the hash and print it */
- hash = crypt(argv[1], argv[2]);
- puts(hash);
- exit(EXIT_SUCCESS);
+ /* All seems well, build the hash and print it */
+ hash = crypt(argv[1], argv[2]);
+ puts(hash);
+ exit(EXIT_SUCCESS);
}
/*
* Show usage to given stream, and exit with given code
*/
void usage(FILE *stream, int status) {
- fputs("USAGE: crypt [-h | KEY SALT]\n", stream);
- exit(status);
+ fputs("USAGE: crypt [-h | KEY SALT]\n", stream);
+ exit(status);
}