Revert "Prevent overflow beyond the end of string in wtf_strwidth()"
This reverts commit d345c0950d
.
This commit is contained in:
@@ -120,14 +120,10 @@ int
|
|||||||
wtf_strwidth(wc_uchar *p)
|
wtf_strwidth(wc_uchar *p)
|
||||||
{
|
{
|
||||||
int w = 0;
|
int w = 0;
|
||||||
size_t len;
|
|
||||||
|
|
||||||
while (*p) {
|
while (*p) {
|
||||||
w += wtf_width(p);
|
w += wtf_width(p);
|
||||||
len = WTF_LEN_MAP[*p];
|
p += WTF_LEN_MAP[*p];
|
||||||
if (len > strlen(p))
|
|
||||||
len = strlen(p);
|
|
||||||
p += len;
|
|
||||||
}
|
}
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user