diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2017-06-18 22:32:21 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2017-06-18 22:32:21 +0300 |
commit | 9ccddb999bb2d79c261702f789deb9371090a4ec (patch) | |
tree | 3ee11d8965d9a1ce0991baacb2a03523d21745fd /builtin.c | |
parent | 49f5a940d4290ee0ba0b4dd706237fbc8434b1d2 (diff) | |
parent | 4264c894681d11d4a5ce694aa8040223726fad1e (diff) | |
download | egawk-9ccddb999bb2d79c261702f789deb9371090a4ec.tar.gz egawk-9ccddb999bb2d79c261702f789deb9371090a4ec.tar.bz2 egawk-9ccddb999bb2d79c261702f789deb9371090a4ec.zip |
Merge branch 'master' into feature/api-mpfr
Diffstat (limited to 'builtin.c')
-rw-r--r-- | builtin.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -4154,12 +4154,13 @@ mbc_char_count(const char *ptr, size_t numbytes) if (mb_len <= 0) return numbytes; /* no valid m.b. char */ - for (; numbytes > 0; numbytes--) { + while (numbytes > 0) { mb_len = mbrlen(ptr, numbytes, &cur_state); if (mb_len <= 0) break; sum++; ptr += mb_len; + numbytes -= mb_len; } return sum; |