summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-30 20:26:13 (GMT)
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-30 20:26:13 (GMT)
commitdea685c783b2b98ca8e848add4f174f15162c65f (patch)
tree69f87bd2a3d4a1e46f828665a5113b5e31e6ce87 /random.c
parent4eeec4869f5d4574dce1b5ab79cb4f9909d4d043 (diff)
* missing/explicit_bzero.c: new file. define explicit_bzero.
* common.mk: add a rule for explicit.o. * configure.in: detect explicit_bzero and memset_s. * include/ruby/missing.h: add explicit_bzero. * random.c (init_randomseed): use explicit_bzero() instead of memset(). memset could be eliminated by compiler optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/random.c b/random.c
index 55a6a6f..b0f638d 100644
--- a/random.c
+++ b/random.c
@@ -1456,7 +1456,7 @@ init_randomseed(struct MT *mt, uint32_t initial[DEFAULT_SEED_CNT])
fill_random_seed(initial);
init_by_array(mt, initial, DEFAULT_SEED_CNT);
seed = make_seed_value(initial);
- memset(initial, 0, DEFAULT_SEED_LEN);
+ explicit_bzero(initial, DEFAULT_SEED_LEN);
return seed;
}