projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fix debugger tracking of shared libraries on mips with PIE main program
[musl]
/
src
/
multibyte
/
btowc.c
diff --git
a/src/multibyte/btowc.c
b/src/multibyte/btowc.c
index
9d2c3b1
..
8acd0a2
100644
(file)
--- a/
src/multibyte/btowc.c
+++ b/
src/multibyte/btowc.c
@@
-1,7
+1,10
@@
#include <stdio.h>
#include <wchar.h>
+#include <stdlib.h>
+#include "internal.h"
wint_t btowc(int c)
{
- return c<128U ? c : EOF;
+ int b = (unsigned char)c;
+ return b<128U ? b : (MB_CUR_MAX==1 && c!=EOF) ? CODEUNIT(c) : WEOF;
}