on master help sign in
Merge pull request #16 from Mikolaj/master

A possible fix for segfault possibly caused by vty

commitda635bb377322f89d1821fb51c71e0e48256c0b4 authorCorey O'Connor <coreyoconnor@gmail.com> dateMon 29 Aug 2011, 22:41 (15 years ago) parenta2cdd0718fe87a
1 file changed+3−3
cbits/mk_wcwidth.c+3−3
cbits/mk_wcwidth.c+3−3
@@ -187,7 +187,7 @@ int mk_wcwidth(wchar_t ucs)
187187
188188 /* if we arrive here, ucs is not a combining or C0/C1 control character */
189189
190− return 1 +
190+ return 1 +
191191 (ucs >= 0x1100 &&
192192 (ucs <= 0x115f || /* Hangul Jamo init. consonants */
193193 ucs == 0x2329 || ucs == 0x232a ||
@@ -208,7 +208,7 @@ int mk_wcswidth(const wchar_t *pwcs, size_t n)
208208{
209209 int w, width = 0;
210210
211− for (;*pwcs && n-- > 0; pwcs++)
211+ for (;n-- > 0; pwcs++)
212212 if ((w = mk_wcwidth(*pwcs)) < 0)
213213 return -1;
214214 else
@@ -299,7 +299,7 @@ int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n)
299299{
300300 int w, width = 0;
301301
302− for (;*pwcs && n-- > 0; pwcs++)
302+ for (;n-- > 0; pwcs++)
303303 if ((w = mk_wcwidth_cjk(*pwcs)) < 0)
304304 return -1;
305305 else