Fix failing test 150_tag_config_invalid_tags on big-endian systems

used (ucs4_t)ascii; in the to ensure compatibility with both
little and big-endian systems.

Fixes:https://github.com/ascii-boxes/boxes/issues/130
This commit is contained in:
Gayathri Berli 2025-01-22 09:12:57 +01:00 committed by Thomas Jensen
parent bae35281d0
commit ba901ba5e7

View File

@ -154,8 +154,7 @@ ucs4_t to_utf32(char ascii)
{
ucs4_t c = char_nul;
if (ascii >= 0x20 && ascii < 0x7f) {
char *bytes = (char *) (&c);
bytes[0] = ascii;
c = (ucs4_t)ascii; // Store the ASCII value directly in c
}
return c;
}