mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 01:28:20 +00:00
Deprecate bro_random(), replace with zeek::random_number()
Avoiding the use of zeek::random() due to potential for confusion with random().
This commit is contained in:
parent
6bbb0a6b48
commit
bde38893ce
7 changed files with 23 additions and 10 deletions
|
@ -45,10 +45,10 @@ std::string Foo::RandomString(const int len)
|
|||
"abcdefghijklmnopqrstuvwxyz";
|
||||
|
||||
for (int i = 0; i < len; ++i)
|
||||
// bro_random is not thread-safe; as we are only using one simultaneous thread
|
||||
// zeek::random_number() is not thread-safe; as we are only using one simultaneous thread
|
||||
// here, this should not matter in this case. If this test ever starts showing
|
||||
// random errors, this might be the culprit.
|
||||
s[i] = values[bro_random() / (RAND_MAX / sizeof(values))];
|
||||
s[i] = values[zeek::random_number() / (RAND_MAX / sizeof(values))];
|
||||
|
||||
return s;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue