diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-12-07 15:54:42 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2016-12-07 15:54:42 +0000 |
commit | 295b1ef8f8d5f579ae62308130e1d913b2ea86e1 (patch) | |
tree | bbfdd29699d422508d50fb271212ec4b9ae8347a /libwc/wtf.c | |
parent | Update ChangeLog (diff) | |
download | w3m-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.c | 6 |
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; } |