From ba901ba5e76e60c420c37363032eb038b9cc961f Mon Sep 17 00:00:00 2001 From: Gayathri Berli Date: Wed, 22 Jan 2025 09:12:57 +0100 Subject: [PATCH] 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 --- src/unicode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/unicode.c b/src/unicode.c index f52aaf9..a3b2b7d 100644 --- a/src/unicode.c +++ b/src/unicode.c @@ -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; }