Skip to content

Negative integral to char overflow Fix#4840

Open
dxchel wants to merge 3 commits into
fmtlib:mainfrom
dxchel:dxchel/integral_to_char_overflow
Open

Negative integral to char overflow Fix#4840
dxchel wants to merge 3 commits into
fmtlib:mainfrom
dxchel:dxchel/integral_to_char_overflow

Conversation

@dxchel

@dxchel dxchel commented Jul 11, 2026

Copy link
Copy Markdown

Closes #4839
Fixed the negative integral overflow issue and added a test to check for 'x' in two's complement

   std::format uses the two's complement for formatting while
   FML used the absolute value, failing to correctly write when
   using values like -104 (FMT used 104 while std uses 152)
@dxchel dxchel requested a review from vitaut as a code owner July 11, 2026 04:01
   Checks for int(-136) which on two's complement should be 'x'
@dxchel dxchel force-pushed the dxchel/integral_to_char_overflow branch from d759a4f to a612e33 Compare July 11, 2026 15:59
   Now using logic operators instead of bit shifting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

:c may overflow with integral values

1 participant