From 85e1012dab425dc50bc3faa2a3f28a9a47dac017 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 1 Feb 2017 21:13:33 +0200 Subject: Fix up mbc_char_count to be correct. --- builtin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'builtin.c') diff --git a/builtin.c b/builtin.c index f71d71dd..f4104764 100644 --- a/builtin.c +++ b/builtin.c @@ -4076,12 +4076,12 @@ mbc_char_count(const char *ptr, size_t numbytes) memset(& cur_state, 0, sizeof(cur_state)); - mb_len = mbrlen(ptr, numbytes * gawk_mb_cur_max, &cur_state); + mb_len = mbrlen(ptr, numbytes, &cur_state); if (mb_len <= 0) return numbytes; /* no valid m.b. char */ for (; numbytes > 0; numbytes--) { - mb_len = mbrlen(ptr, numbytes * gawk_mb_cur_max, &cur_state); + mb_len = mbrlen(ptr, numbytes, &cur_state); if (mb_len <= 0) break; sum++; -- cgit v1.2.3