Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
musl
/
d41cdef9198e635270d30e82be939d4ea0cbce82
/
.
/
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
;
}