locale: Fix --enable-ubsan build failure on some ABIs
On mips, arc, powerpc, and s390 gcc 14 triggers the warning
In function ‘charmap_new_char’,
inlined from ‘parse_charmap.isra’ at ../locale/programs/charmap.c:570:6:
../locale/programs/charmap.c:1017:32: error: ‘strncmp’ specified bound [
2147483649,
4294967295] exceeds maximum object size
2147483647 [-Werror=stringop-overread]
1017 | if (cp == &from[len1 - 1] || strncmp (from, to, prefix_len) != 0)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../locale/programs/charmap.c:1017:32: error: ‘strncmp’ specified bound [
2147483649,
4294967295] exceeds maximum object size
2147483647 [-Werror=stringop-overread]
cc1: all warnings being treated as errors
So move the case to an special function and disable the sanitizer.