File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1393,15 +1393,16 @@ utility::seconds __cdecl timespan::xml_duration_to_seconds(const utility::string
13931393 return utility::seconds (numSecs);
13941394}
13951395
1396- static const utility:: char_t c_allowed_chars[] =
1397- _XPLATSTR ( " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 " );
1396+ static const char c_allowed_chars[] = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 " ;
1397+ static const int chars_count = static_cast < int >( sizeof (c_allowed_chars) - 1 );
13981398
13991399utility::string_t nonce_generator::generate ()
14001400{
1401- std::uniform_int_distribution<> distr (0 , static_cast < int >( sizeof (c_allowed_chars) / sizeof (utility:: char_t )) - 1 );
1401+ std::uniform_int_distribution<> distr (0 , chars_count - 1 );
14021402 utility::string_t result;
14031403 result.reserve (length ());
1404- std::generate_n (std::back_inserter (result), length (), [&]() { return c_allowed_chars[distr (m_random)]; });
1404+ std::generate_n (std::back_inserter (result), length (),
1405+ [&] { return static_cast <utility::char_t >(c_allowed_chars[distr (m_random)]); });
14051406 return result;
14061407}
14071408
You can’t perform that action at this time.
0 commit comments