Skip to content

Commit 1a373ee

Browse files
yaacov Hazanyaacov Hazan
authored andcommitted
fix issue #158, gaussian key-pattern on MAC OS
in case we are using jrand48 and generate a random number, all the bits (except for the last bit) are reset, instead of resetting only the last bit.
1 parent 18d2646 commit 1a373ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

obj_gen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ unsigned long long random_generator::get_random()
8282

8383
rn = jrand48(m_data_blob);
8484
llrn |= rn & 0xffffffff; // reset the sign extension bits of negative numbers
85-
llrn &= 0x8000000000000000; // avoid any trouble from sign mismatch and negative numbers
85+
llrn &= 0x7FFFFFFFFFFFFFFF; // avoid any trouble from sign mismatch and negative numbers
8686
#else
8787
#error no random function
8888
#endif

0 commit comments

Comments
 (0)