aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-04-20 09:32:12 +1200
committerTom Ryder <tom@sanctum.geek.nz>2015-04-20 09:32:12 +1200
commit04385944be3476c3a96df34f168687fad539a94b (patch)
tree5b0a26990ac91ee3a48459f61335c54ffc9d35b5
parentSpecify .PHONY targets (diff)
downloadcrypt-04385944be3476c3a96df34f168687fad539a94b.tar.gz
crypt-04385944be3476c3a96df34f168687fad539a94b.zip
ICO C90 forbids mixed declarations and code
-rw-r--r--Makefile1
-rw-r--r--crypt.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 708b474..3be6b7a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
.PHONY: all clean install
+CFLAGS = -Wall -Wextra -ansi -pedantic
LDFLAGS = -lcrypt
PREFIX := /usr/local
diff --git a/crypt.c b/crypt.c
index f4d3a11..8134793 100644
--- a/crypt.c
+++ b/crypt.c
@@ -13,6 +13,9 @@
*/
int main (int argc, char **argv)
{
+ /* The hash we will produce, hopefully */
+ char *hash = NULL;
+
/* Assume user doesn't want help */
int help = 0;
@@ -44,7 +47,7 @@ int main (int argc, char **argv)
}
/* All seems well, build the hash and print it */
- char *hash = crypt(argv[1], argv[2]);
+ hash = crypt(argv[1], argv[2]);
fprintf(stdout, "%s\n", hash);
exit(EXIT_SUCCESS);
}