about summary refs log tree commit diff
path: root/src/multibyte/wctob.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/multibyte/wctob.c')
-rw-r--r--src/multibyte/wctob.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/multibyte/wctob.c b/src/multibyte/wctob.c
index d6353ee1..4aeda6a1 100644
--- a/src/multibyte/wctob.c
+++ b/src/multibyte/wctob.c
@@ -1,8 +1,10 @@
-#include <stdio.h>
 #include <wchar.h>
+#include <stdlib.h>
+#include "internal.h"
 
 int wctob(wint_t c)
 {
 	if (c < 128U) return c;
+	if (MB_CUR_MAX==1 && IS_CODEUNIT(c)) return (unsigned char)c;
 	return EOF;
 }