summaryrefslogtreecommitdiffstats
path: root/lib/libcrypt/crypt.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1996-10-14 08:34:02 +0000
committerphk <phk@FreeBSD.org>1996-10-14 08:34:02 +0000
commit99256fa202d60d819bc54c0de7f264f1b8405676 (patch)
tree6bc711aa9326459ed3649791231fd0b51400561a /lib/libcrypt/crypt.c
parent14dd70138e60ac6a0d2d9ffed2cca51ffe94ab78 (diff)
downloadFreeBSD-src-99256fa202d60d819bc54c0de7f264f1b8405676.zip
FreeBSD-src-99256fa202d60d819bc54c0de7f264f1b8405676.tar.gz
A couple of minor nits.
Submitted by: Craig Leres <leres@ee.lbl.gov> Submitted by: Theo Deraadt <deraadt@theos.com>
Diffstat (limited to 'lib/libcrypt/crypt.c')
-rw-r--r--lib/libcrypt/crypt.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/libcrypt/crypt.c b/lib/libcrypt/crypt.c
index 7f980e5..ce7b9ee 100644
--- a/lib/libcrypt/crypt.c
+++ b/lib/libcrypt/crypt.c
@@ -6,28 +6,33 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: crypt.c,v 1.3 1995/05/30 05:42:22 rgrimes Exp $
+ * $Id: crypt.c,v 1.4 1996/07/12 18:56:01 jkh Exp $
*
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Header: /home/ncvs/src/lib/libcrypt/crypt.c,v 1.3 1995/05/30 05:42:22 rgrimes Exp $";
+static char rcsid[] = "$Header: /home/ncvs/src/lib/libcrypt/crypt.c,v 1.4 1996/07/12 18:56:01 jkh Exp $";
#endif /* LIBC_SCCS and not lint */
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <md5.h>
+#include <string.h>
static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+static void to64 __P((char *, unsigned long, int));
+
static void
to64(s, v, n)
char *s;
unsigned long v;
int n;
{
+static void to64 __P((char *, unsigned long, int));
+
while (--n >= 0) {
*s++ = itoa64[v&0x3f];
v >>= 6;
@@ -96,11 +101,11 @@ crypt(pw, salt)
memset(final,0,sizeof final);
/* Then something really weird... */
- for (j=0,i = strlen(pw); i ; i >>= 1)
+ for (i = strlen(pw); i ; i >>= 1)
if(i&1)
- MD5Update(&ctx, final+j, 1);
+ MD5Update(&ctx, final, 1);
else
- MD5Update(&ctx, pw+j, 1);
+ MD5Update(&ctx, pw, 1);
/* Now make the output string */
strcpy(passwd,magic);
OpenPOWER on IntegriCloud