summaryrefslogtreecommitdiff
path: root/src/memtest.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2012-04-27 16:28:31 +0200
committerantirez <antirez@gmail.com>2012-04-27 16:29:44 +0200
commitffe003dcbe9e719659f9a9d690f5bc5fd7b0615e (patch)
treee75a693c3c2d402d5cd0131f90797af8e0c2ee4e /src/memtest.c
parent841048f2c832b41d168b10cea6d80c1ab3c49dca (diff)
downloadredis-ffe003dcbe9e719659f9a9d690f5bc5fd7b0615e.tar.gz
memtest.c fixed to actually use v1 and v2 in memtest_fill_value().
Diffstat (limited to 'src/memtest.c')
-rw-r--r--src/memtest.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/memtest.c b/src/memtest.c
index 09b4d831b..88c7213af 100644
--- a/src/memtest.c
+++ b/src/memtest.c
@@ -132,13 +132,13 @@ void memtest_fill_value(unsigned long *l, size_t bytes, unsigned long v1,
v = (off & 1) ? v2 : v1;
for (w = 0; w < iwords; w++) {
#ifdef MEMTEST_32BIT
- *l1 = *l2 = ((unsigned long) (rand()&0xffff)) |
- (((unsigned long) (rand()&0xffff)) << 16);
+ *l1 = *l2 = ((unsigned long) v) |
+ (((unsigned long) v) << 16);
#else
- *l1 = *l2 = ((unsigned long) (rand()&0xffff)) |
- (((unsigned long) (rand()&0xffff)) << 16) |
- (((unsigned long) (rand()&0xffff)) << 32) |
- (((unsigned long) (rand()&0xffff)) << 48);
+ *l1 = *l2 = ((unsigned long) v) |
+ (((unsigned long) v) << 16) |
+ (((unsigned long) v) << 32) |
+ (((unsigned long) v) << 48);
#endif
l1 += step;
l2 += step;