mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
AK+Format: Don't cast to size_t when you want u64.
In Serenity, size_t is defined as u32, thus static_cast<size_t>(value) truncates the value.
This commit is contained in:
parent
b445f15131
commit
35a1e12459
Notes:
sideshowbarker
2024-07-18 22:22:02 +09:00
Author: https://github.com/asynts
Commit: 35a1e12459
Pull-request: https://github.com/SerenityOS/serenity/pull/5320
Issue: https://github.com/SerenityOS/serenity/issues/5308
Reviewed-by: https://github.com/BenWiederhake
4 changed files with 51 additions and 1 deletions
|
@ -368,7 +368,7 @@ void FormatBuilder::put_i64(
|
|||
const auto is_negative = value < 0;
|
||||
value = is_negative ? -value : value;
|
||||
|
||||
put_u64(static_cast<size_t>(value), base, prefix, upper_case, zero_pad, align, min_width, fill, sign_mode, is_negative);
|
||||
put_u64(static_cast<u64>(value), base, prefix, upper_case, zero_pad, align, min_width, fill, sign_mode, is_negative);
|
||||
}
|
||||
|
||||
#ifndef KERNEL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue