Fix gcc warning.

GitOrigin-RevId: e4d1ebf7674a95c4ae292322679575daa08d9924
This commit is contained in:
levlam 2018-04-06 19:58:16 +03:00
parent f97de8b6ae
commit a48fe6d2a5

View File

@ -175,7 +175,7 @@ Secret Secret::create_new() {
auto secret_slice = td::as_slice(secret);
Random::secure_bytes(secret_slice);
auto checksum_diff = secret_checksum(secret_slice);
uint8 new_byte = (static_cast<uint32>(secret_slice.ubegin()[0]) + checksum_diff) % 255;
uint8 new_byte = static_cast<uint8>((static_cast<uint32>(secret_slice.ubegin()[0]) + checksum_diff) % 255);
secret_slice.ubegin()[0] = new_byte;
return create(secret_slice).move_as_ok();
}