summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2003-04-10 09:20:38 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2003-04-10 09:20:38 +0000
commite3e8878435ea88f45bce56e6d49e962bbdcf6547 (patch)
tree8b968f59182a9e4146766987ede1f1fb6c47ae80 /lib/libc
parent5bff20ef7c7d983b915ce42fc4dc0c5eef6ee064 (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/locale/wcrtomb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/locale/wcrtomb.c b/lib/libc/locale/wcrtomb.c
index a76f03159386..7bebd1ad97bf 100644
--- a/lib/libc/locale/wcrtomb.c
+++ b/lib/libc/locale/wcrtomb.c
@@ -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;