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
1393
1393
return utility::seconds (numSecs);
1394
1394
}
1395
1395
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 );
1398
1398
1399
1399
utility::string_t nonce_generator::generate ()
1400
1400
{
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 );
1402
1402
utility::string_t result;
1403
1403
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)]); });
1405
1406
return result;
1406
1407
}
1407
1408
You can’t perform that action at this time.
0 commit comments