diff options
| author | 2023-07-15 13:10:51 +0100 | |
|---|---|---|
| committer | 2023-07-15 13:17:19 +0100 | |
| commit | 978524b9acebab8df6b788a6ed9ebfcfe0f12eec (patch) | |
| tree | 2ad2004d75e7b0277aa8255725547178150bacf5 /src/helperfuncs.cpp | |
| parent | Merge branch 'insp3' into master. (diff) | |
Work around MSVC not implementing uniform_int_distribution<char>.
Diffstat (limited to 'src/helperfuncs.cpp')
| -rw-r--r-- | src/helperfuncs.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index f3a994007..4da2a4d3d 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -463,8 +463,8 @@ void InspIRCd::DefaultGenRandom(char* output, size_t max) #else static std::random_device device; static std::mt19937 engine(device()); - static std::uniform_int_distribution<char> dist; + static std::uniform_int_distribution<short> dist(CHAR_MIN, CHAR_MAX); for (size_t i = 0; i < max; ++i) - output[i] = dist(engine); + output[i] = static_cast<char>(dist(engine)); #endif } |
