diff options
Diffstat (limited to 'libc-top-half/musl/src/ctype/wcswidth.c')
-rw-r--r-- | libc-top-half/musl/src/ctype/wcswidth.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/ctype/wcswidth.c b/libc-top-half/musl/src/ctype/wcswidth.c new file mode 100644 index 0000000..5c8a5a4 --- /dev/null +++ b/libc-top-half/musl/src/ctype/wcswidth.c @@ -0,0 +1,8 @@ +#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; +} |