crypt.c
changeset 56 966ad681f25d
parent 32 9b56360ec64e
child 74 829976007e62
--- a/crypt.c
+++ b/crypt.c
@@ -12,7 +12,7 @@
 
 int main (int argc, char **argv)
 {
-    char salt[20] = { 0 };
+    char salt[12] = { 0 };
 
     if (argc != 2) {
         printf ("Usage: %s <plaintext>\n", argv[0]);
@@ -21,7 +21,9 @@
 
     srand (time (NULL));
 
-    sprintf (salt, "$1$%c%c", GETRANDOM (26), GETRANDOM (26));
+    sprintf (salt, "$1$%c%c%c%c%c%c%c%c",
+             GETRANDOM (26), GETRANDOM (26),
+             GETRANDOM (26), GETRANDOM (26), GETRANDOM (26), GETRANDOM (26), GETRANDOM (26), GETRANDOM (26));
 
     printf ("%s\n", crypt (argv[1], salt));
     return EXIT_SUCCESS;