Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2f606ed

Browse files
committed
Remove another useless, counterproductive srandom() call.
1 parent48beecd commit2f606ed

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

‎contrib/chkpass/chkpass.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* darcy@druid.net
55
* http://www.druid.net/darcy/
66
*
7-
* $Id: chkpass.c,v 1.10 2003/07/24 17:52:12 tgl Exp $
7+
* $Id: chkpass.c,v 1.11 2003/09/07 15:27:25 tgl Exp $
88
* best viewed with tabs set to 4
99
*/
1010

@@ -69,7 +69,6 @@ chkpass_in(PG_FUNCTION_ARGS)
6969
char*str=PG_GETARG_CSTRING(0);
7070
chkpass*result;
7171
charmysalt[4];
72-
staticboolrandom_initialized= false;
7372
staticcharsalt_chars[]=
7473
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
7574

@@ -93,12 +92,6 @@ chkpass_in(PG_FUNCTION_ARGS)
9392

9493
result= (chkpass*)palloc(sizeof(chkpass));
9594

96-
if (!random_initialized)
97-
{
98-
srandom((unsignedint)time(NULL));
99-
random_initialized= true;
100-
}
101-
10295
mysalt[0]=salt_chars[random()&0x3f];
10396
mysalt[1]=salt_chars[random()&0x3f];
10497
mysalt[2]=0;/* technically the terminator is not

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp