diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-10-15 09:25:33 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-10-15 09:25:33 +0000 |
commit | 91a906bb1f36f1a9eb608af55fa83a7daa3efab2 (patch) | |
tree | 5a18f8874b7773d636f28b4a356134840202d407 /lib/libc/crypt | |
parent | 25a1682f36e398a36dec650a3bdaeed57b122edb (diff) |
unused variable noticed by asriel(right?), proto from mccanne; fed to freebsd
Diffstat (limited to 'lib/libc/crypt')
-rw-r--r-- | lib/libc/crypt/md5crypt.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/libc/crypt/md5crypt.c b/lib/libc/crypt/md5crypt.c index 3e3c681c8eb..4b99360f105 100644 --- a/lib/libc/crypt/md5crypt.c +++ b/lib/libc/crypt/md5crypt.c @@ -1,3 +1,5 @@ +/* $OpenBSD: md5crypt.c,v 1.6 1996/10/15 09:25:32 deraadt Exp $ */ + /* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): @@ -6,20 +8,25 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * + * $FreeBSD: crypt.c,v 1.5 1996/10/14 08:34:02 phk Exp $ + * */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.5 1996/09/15 09:30:46 tholo Exp $"; +static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.6 1996/10/15 09:25:32 deraadt 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; @@ -47,7 +54,7 @@ md5crypt(pw, salt) * This string is magic for this algorithm. Having * it this way, we can get get better later on */ - static char *magic = "$1$"; + static char *magic = "$1$"; static char passwd[120], *p; static const char *sp,*ep; @@ -94,11 +101,11 @@ md5crypt(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); |