aboutsummaryrefslogtreecommitdiffstats
path: root/libwc/wtf.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-12-07 15:54:42 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-12-07 15:54:42 +0000
commit295b1ef8f8d5f579ae62308130e1d913b2ea86e1 (patch)
treebbfdd29699d422508d50fb271212ec4b9ae8347a /libwc/wtf.c
parentUpdate ChangeLog (diff)
downloadw3m-295b1ef8f8d5f579ae62308130e1d913b2ea86e1.tar.gz
w3m-295b1ef8f8d5f579ae62308130e1d913b2ea86e1.zip
Revert "Prevent overflow beyond the end of string in wtf_strwidth()"
This reverts commit d345c0950dfdef065b7377ecad0e4bc1d2601bf8.
Diffstat (limited to '')
-rw-r--r--libwc/wtf.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libwc/wtf.c b/libwc/wtf.c
index 69a8271..b8cfdc7 100644
--- a/libwc/wtf.c
+++ b/libwc/wtf.c
@@ -120,14 +120,10 @@ int
wtf_strwidth(wc_uchar *p)
{
int w = 0;
- size_t len;
while (*p) {
w += wtf_width(p);
- len = WTF_LEN_MAP[*p];
- if (len > strlen(p))
- len = strlen(p);
- p += len;
+ p += WTF_LEN_MAP[*p];
}
return w;
}