提交 b0fc7852 编写于 作者: R Rich Felker

fix argument type error on wcwidth function

since the correct declaration was not visible, and since the
representation of the types wchar_t and wint_t always match, a
compiler would have to go out of its way to make this bug manifest,
but better to fix it anyway.
上级 129ca6c0
#include <wctype.h> #include <wchar.h>
static unsigned char table[] = { static unsigned char table[] = {
#include "nonspacing.h" #include "nonspacing.h"
...@@ -8,7 +8,7 @@ static unsigned char wtable[] = { ...@@ -8,7 +8,7 @@ static unsigned char wtable[] = {
#include "wide.h" #include "wide.h"
}; };
int wcwidth(wint_t wc) int wcwidth(wchar_t wc)
{ {
if (wc < 0xffU) if (wc < 0xffU)
return (wc+1 & 0x7f) >= 0x21 ? 1 : wc ? -1 : 0; return (wc+1 & 0x7f) >= 0x21 ? 1 : wc ? -1 : 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册