From 295b1ef8f8d5f579ae62308130e1d913b2ea86e1 Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Thu, 8 Dec 2016 00:54:42 +0900 Subject: Revert "Prevent overflow beyond the end of string in wtf_strwidth()" This reverts commit d345c0950dfdef065b7377ecad0e4bc1d2601bf8. --- libwc/wtf.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'libwc') 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; } -- cgit v1.2.3