mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
When called with s == NULL, behave as if wc == L'\0' as required by the
standard.
This commit is contained in:
parent
5bff20ef7c
commit
e3e8878435
1 changed files with 3 additions and 1 deletions
|
|
@ -39,8 +39,10 @@ wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps __unused)
|
|||
char *e;
|
||||
char buf[MB_LEN_MAX];
|
||||
|
||||
if (s == NULL)
|
||||
if (s == NULL) {
|
||||
s = buf;
|
||||
wc = L'\0';
|
||||
}
|
||||
sputrune(wc, s, MB_CUR_MAX, &e);
|
||||
if (e == NULL) {
|
||||
errno = EILSEQ;
|
||||
|
|
|
|||
Loading…
Reference in a new issue