diff options
author | ache <ache@FreeBSD.org> | 2002-08-17 14:16:14 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2002-08-17 14:16:14 +0000 |
commit | 1a00890ca4d73767905763a29f366f434112e6cb (patch) | |
tree | 47e191bbbf22c4284cd0d76d37bf8a81ff77a57c /lib/libc | |
parent | aa14f489f215c5ecae9ed42b707ce304021826c7 (diff) | |
download | FreeBSD-src-1a00890ca4d73767905763a29f366f434112e6cb.zip FreeBSD-src-1a00890ca4d73767905763a29f366f434112e6cb.tar.gz |
wcwidth: fix espression to work correctly with SWIDTH0
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/locale/iswctype.c | 6 |
1 files changed, 4 insertions, 2 deletions
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); } |