aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-09-07 15:27:25 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-09-07 15:27:25 +0000
commit2f606ed87dc31a1183cd60fb99acb6ef6fb80e19 (patch)
tree6c9e33a2bc4c7480c75578376fb725c34950c705
parent48beecda7cbd2e73ebc11c88d3567ad064604bda (diff)
downloadpostgresql-2f606ed87dc31a1183cd60fb99acb6ef6fb80e19.tar.gz
postgresql-2f606ed87dc31a1183cd60fb99acb6ef6fb80e19.zip
Remove another useless, counterproductive srandom() call.
-rw-r--r--contrib/chkpass/chkpass.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/contrib/chkpass/chkpass.c b/contrib/chkpass/chkpass.c
index 4cd67ea75e9..dc8a418232f 100644
--- a/contrib/chkpass/chkpass.c
+++ b/contrib/chkpass/chkpass.c
@@ -4,7 +4,7 @@
* darcy@druid.net
* http://www.druid.net/darcy/
*
- * $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 $
* best viewed with tabs set to 4
*/
@@ -69,7 +69,6 @@ chkpass_in(PG_FUNCTION_ARGS)
char *str = PG_GETARG_CSTRING(0);
chkpass *result;
char mysalt[4];
- static bool random_initialized = false;
static char salt_chars[] =
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
@@ -93,12 +92,6 @@ chkpass_in(PG_FUNCTION_ARGS)
result = (chkpass *) palloc(sizeof(chkpass));
- if (!random_initialized)
- {
- srandom((unsigned int) time(NULL));
- random_initialized = true;
- }
-
mysalt[0] = salt_chars[random() & 0x3f];
mysalt[1] = salt_chars[random() & 0x3f];
mysalt[2] = 0; /* technically the terminator is not