musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/multibyte/btowc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/multibyte/btowc.c')
-rw-r--r--src/multibyte/btowc.c 6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/multibyte/btowc.c b/src/multibyte/btowc.c
index 29cb798d..8acd0a2c 100644
--- a/src/multibyte/btowc.c
+++ b/src/multibyte/btowc.c
@@ -1,8 +1,10 @@
#include <stdio.h>
#include <wchar.h>
+#include <stdlib.h>
+#include "internal.h"
wint_t btowc(int c)
{
- c = (unsigned char)c;
- return c<128U ? c : EOF;
+ int b = (unsigned char)c;
+ return b<128U ? b : (MB_CUR_MAX==1 && c!=EOF) ? CODEUNIT(c) : WEOF;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月17日 19:02:43 +0000

AltStyle によって変換されたページ (->オリジナル) /