Skip to content
Snippets Groups Projects
Commit 74b3d33a authored by Marcus Comstedt's avatar Marcus Comstedt
Browse files

const to the people!

Rev: src/crypt.c:1.9
Rev: src/global.h:1.95
parent 2a195c6f
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
|| This file is part of Pike. For copyright information see COPYRIGHT. || This file is part of Pike. For copyright information see COPYRIGHT.
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
|| for more information. || for more information.
|| $Id: crypt.c,v 1.8 2003/11/11 13:47:26 grubba Exp $ || $Id: crypt.c,v 1.9 2003/12/07 19:42:03 marcus Exp $
*/ */
/* /*
...@@ -214,12 +214,12 @@ static void encrypt(char *blck, int edflag) ...@@ -214,12 +214,12 @@ static void encrypt(char *blck, int edflag)
transpose(p, &FinalTr, 64); transpose(p, &FinalTr, 64);
} }
char *crypt(char *pw, char *salt) char *crypt(const char *pw, const char *salt)
{ {
char pwb[66]; char pwb[66];
static char result[16]; static char result[16];
register char *p = pwb; register char *p = pwb, *p2;
struct ordering new_etr; struct ordering new_etr;
register int i; register int i;
...@@ -265,7 +265,7 @@ char *crypt(char *pw, char *salt) ...@@ -265,7 +265,7 @@ char *crypt(char *pw, char *salt)
EP = &etr; EP = &etr;
p = pwb; p = pwb;
pw = result+2; p2 = result+2;
while (p < &pwb[66]) { while (p < &pwb[66]) {
register int c = 0; register int c = 0;
register int j = 6; register int j = 6;
...@@ -277,8 +277,8 @@ char *crypt(char *pw, char *salt) ...@@ -277,8 +277,8 @@ char *crypt(char *pw, char *salt)
c += '.'; /* becomes >= '.' */ c += '.'; /* becomes >= '.' */
if (c > '9') c += 7; /* not in [./0-9], becomes upper */ if (c > '9') c += 7; /* not in [./0-9], becomes upper */
if (c > 'Z') c += 6; /* not in [A-Z], becomes lower */ if (c > 'Z') c += 6; /* not in [A-Z], becomes lower */
*pw++ = (char) c; *p2++ = (char) c;
} }
*pw = 0; *p2 = 0;
return result; return result;
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
|| This file is part of Pike. For copyright information see COPYRIGHT. || This file is part of Pike. For copyright information see COPYRIGHT.
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
|| for more information. || for more information.
|| $Id: global.h,v 1.94 2003/11/07 18:28:05 mast Exp $ || $Id: global.h,v 1.95 2003/12/07 19:42:03 marcus Exp $
*/ */
#ifndef GLOBAL_H #ifndef GLOBAL_H
...@@ -472,7 +472,7 @@ char *getenv PROT((char *)); ...@@ -472,7 +472,7 @@ char *getenv PROT((char *));
#endif #endif
#ifdef USE_CRYPT_C #ifdef USE_CRYPT_C
char *crypt(char *, char *); char *crypt(const char *, const char *);
#endif /* USE_CRYPT_C */ #endif /* USE_CRYPT_C */
/* If this define is present, error() has been renamed to Pike_error() and /* If this define is present, error() has been renamed to Pike_error() and
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment