1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-28 11:57:28 +00:00

According to SUSv2, always return 0 for null wide-character code

This commit is contained in:
Andrey A. Chernov 2002-08-19 18:06:18 +00:00
parent 27f2eac7f3
commit 1e2cd54448
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=102124

View File

@ -52,7 +52,12 @@ int
wcwidth(wc)
wchar_t wc;
{
int width = __maskrune(wc, _CTYPE_SWM);
int width;
if (wc == 0)
return (0);
width = __maskrune(wc, _CTYPE_SWM);
/* 0 is autowidth (default) */
return (width ? (int)((unsigned)width >> _CTYPE_SWS)