Sign in
android
/
platform
/
external
/
musl
/
aa59d7880b1194c821029d464f93561a2600d57e
/
.
/
src
/
ctype
/
wcswidth.c
blob: 5c8a5a4dadc2bc7fb41dbdd68d8fb5debdabae6b [
file
] [
log
] [
blame
]
#include
<wchar.h>
int
wcswidth
(
const
wchar_t
*
wcs
,
size_t
n
)
{
int
l
=
0
,
k
=
0
;
for
(;
n
--
&&
*
wcs
&&
(
k
=
wcwidth
(*
wcs
))
>=
0
;
l
+=
k
,
wcs
++);
return
(
k
<
0
)
?
k
:
l
;
}