on master help sign in
Merge pull request #16 from Mikolaj/master
da635bbCorey O'Connor
cbits/mk_wcwidth.c+3−3
@@ -187,7 +187,7 @@ int mk_wcwidth(wchar_t ucs)
187
187
188 /* if we arrive here, ucs is not a combining or C0/C1 control character */
188 /* if we arrive here, ucs is not a combining or C0/C1 control character */
189
189
190− return 1 +
190+ return 1 +
191 (ucs >= 0x1100 &&
191 (ucs >= 0x1100 &&
192 (ucs <= 0x115f || /* Hangul Jamo init. consonants */
192 (ucs <= 0x115f || /* Hangul Jamo init. consonants */
193 ucs == 0x2329 || ucs == 0x232a ||
193 ucs == 0x2329 || ucs == 0x232a ||
@@ -208,7 +208,7 @@ int mk_wcswidth(const wchar_t *pwcs, size_t n)
208{
208{
209 int w, width = 0;
209 int w, width = 0;
210
210
211− for (;*pwcs && n-- > 0; pwcs++)
211+ for (;n-- > 0; pwcs++)
212 if ((w = mk_wcwidth(*pwcs)) < 0)
212 if ((w = mk_wcwidth(*pwcs)) < 0)
213 return -1;
213 return -1;
214 else
214 else
@@ -299,7 +299,7 @@ int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n)
299{
299{
300 int w, width = 0;
300 int w, width = 0;
301
301
302− for (;*pwcs && n-- > 0; pwcs++)
302+ for (;n-- > 0; pwcs++)
303 if ((w = mk_wcwidth_cjk(*pwcs)) < 0)
303 if ((w = mk_wcwidth_cjk(*pwcs)) < 0)
304 return -1;
304 return -1;
305 else
305 else