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;
}