From 1a00890ca4d73767905763a29f366f434112e6cb Mon Sep 17 00:00:00 2001 From: ache Date: Sat, 17 Aug 2002 14:16:14 +0000 Subject: wcwidth: fix espression to work correctly with SWIDTH0 --- lib/libc/locale/iswctype.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/locale/iswctype.c b/lib/libc/locale/iswctype.c index 7e7b3b9..bc0632b 100644 --- a/lib/libc/locale/iswctype.c +++ b/lib/libc/locale/iswctype.c @@ -217,7 +217,9 @@ int wcwidth(wc) wchar_t wc; { - int width = (unsigned)__maskrune((wc), _CTYPE_SWM) >> _CTYPE_SWS; - return width ? width : iswprint(wc); + int width = __maskrune(wc, _CTYPE_SWM); + + return (width ? (unsigned)width >> _CTYPE_SWS + : iswprint(wc) != 0); } -- cgit v1.1