We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent48beecd commit2f606edCopy full SHA for 2f606ed
contrib/chkpass/chkpass.c
@@ -4,7 +4,7 @@
4
* darcy@druid.net
5
* http://www.druid.net/darcy/
6
*
7
- * $Id: chkpass.c,v 1.10 2003/07/24 17:52:12 tgl Exp $
+ * $Id: chkpass.c,v 1.11 2003/09/07 15:27:25 tgl Exp $
8
* best viewed with tabs set to 4
9
*/
10
@@ -69,7 +69,6 @@ chkpass_in(PG_FUNCTION_ARGS)
69
char*str=PG_GETARG_CSTRING(0);
70
chkpass*result;
71
charmysalt[4];
72
-staticboolrandom_initialized= false;
73
staticcharsalt_chars[]=
74
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
75
@@ -93,12 +92,6 @@ chkpass_in(PG_FUNCTION_ARGS)
93
92
94
result= (chkpass*)palloc(sizeof(chkpass));
95
96
-if (!random_initialized)
97
-{
98
-srandom((unsignedint)time(NULL));
99
-random_initialized= true;
100
-}
101
-
102
mysalt[0]=salt_chars[random()&0x3f];
103
mysalt[1]=salt_chars[random()&0x3f];
104
mysalt[2]=0;/* technically the terminator is not