aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lauxlib.c b/lauxlib.c
index 927e36f0..ab3c7c93 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1139,12 +1139,11 @@ static unsigned int luai_makeseed (void) {
1139 unsigned int res; 1139 unsigned int res;
1140 unsigned int i; 1140 unsigned int i;
1141 time_t t = time(NULL); 1141 time_t t = time(NULL);
1142 void *h = buff;
1143 char *b = (char*)buff; 1142 char *b = (char*)buff;
1144 addbuff(b, h); /* local variable's address */ 1143 addbuff(b, b); /* local variable's address */
1145 addbuff(b, t); /* time */ 1144 addbuff(b, t); /* time */
1146 /* fill (rare but possible) remain of the buffer with zeros */ 1145 /* fill (rare but possible) remain of the buffer with zeros */
1147 memset(b, 0, BUFSEED * sizeof(int) - BUFSEEDB); 1146 memset(b, 0, sizeof(buff) - BUFSEEDB);
1148 res = buff[0]; 1147 res = buff[0];
1149 for (i = 0; i < BUFSEED; i++) 1148 for (i = 0; i < BUFSEED; i++)
1150 res ^= (res >> 3) + (res << 7) + buff[i]; 1149 res ^= (res >> 3) + (res << 7) + buff[i];