[Utils]: Code style update (#990)

This commit is contained in:
Edo 2023-04-30 13:07:45 +01:00 committed by GitHub
parent ad59acc457
commit 5b04b71c4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,13 +19,13 @@ namespace Utils
std::string Rand::GenerateChallenge() std::string Rand::GenerateChallenge()
{ {
char buffer[512]{}; char buffer[512]{};
int buffer_pos = 0; int pos = 0;
buffer_pos += sprintf_s(&buffer[buffer_pos], sizeof(buffer) - buffer_pos, "%X", GenerateInt()); pos += sprintf_s(&buffer[pos], sizeof(buffer) - pos, "%X", GenerateInt());
buffer_pos += sprintf_s(&buffer[buffer_pos], sizeof(buffer) - buffer_pos, "%X", ~timeGetTime() ^ GenerateInt()); pos += sprintf_s(&buffer[pos], sizeof(buffer) - pos, "%X", ~timeGetTime() ^ GenerateInt());
buffer_pos += sprintf_s(&buffer[buffer_pos], sizeof(buffer) - buffer_pos, "%X", GenerateInt()); pos += sprintf_s(&buffer[pos], sizeof(buffer) - pos, "%X", GenerateInt());
return std::string(buffer, static_cast<std::size_t>(buffer_pos)); return std::string(buffer, static_cast<std::size_t>(pos));
} }
std::uint32_t Rand::GenerateInt() std::uint32_t Rand::GenerateInt()