1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-04 12:52:15 +00:00

In g_Ctoc() apply CHAR() macro to *str to strip all flags. It gains nothing

right now, but some architectures theoretically may 64-bit wchar_t and the
code looks more correct.
This commit is contained in:
Andrey A. Chernov 2016-07-17 11:25:24 +00:00
parent aa3d69a636
commit 7e9488dda3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=302944

View File

@ -979,14 +979,14 @@ g_Ctoc(const Char *str, char *buf, size_t len)
memset(&mbs, 0, sizeof(mbs));
while (len >= MB_CUR_MAX) {
clen = wcrtomb(buf, *str, &mbs);
clen = wcrtomb(buf, CHAR(*str), &mbs);
if (clen == (size_t)-1) {
/* XXX See initial comment #2. */
*buf = (char)*str;
*buf = (char)CHAR(*str);
clen = 1;
memset(&mbs, 0, sizeof(mbs));
}
if (*buf == '\0')
if (CHAR(*str) == EOS)
return (0);
str++;
buf += clen;