1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-12-04 14:46:45 -05:00

Use the wide-character version of EILSEQ_REPL

This commit is contained in:
John Zaitseff 2018-08-24 13:32:32 +10:00
parent 7647561a92
commit 98696aa91c

View File

@ -645,10 +645,10 @@ ssize_t xwcsfmon (wchar_t *restrict buf, size_t maxsize,
on locales such as ru_RU.UTF-8 which use U+00A0 NO-BREAK SPACE on locales such as ru_RU.UTF-8 which use U+00A0 NO-BREAK SPACE
for mon_thousands_sep (stored in UTF-8 as 0xC2 0xA0. As a for mon_thousands_sep (stored in UTF-8 as 0xC2 0xA0. As a
result, incomplete character sequences are copied, which are result, incomplete character sequences are copied, which are
translated to EILSEQ_REPL characters by xmbstowcs() above. translated to EILSEQ_REPL_WC characters by xmbstowcs() above.
Fix such characters by replacing them with a space. */ Fix such characters by replacing them with a space. */
for (wchar_t *p = buf; *p != L'\0'; p++) { for (wchar_t *p = buf; *p != L'\0'; p++) {
if (*p == EILSEQ_REPL) { if (*p == EILSEQ_REPL_WC) {
*p = L' '; *p = L' ';
} }
} }