ref: 14ba0ff3bd9d073e710bf1c745351e0f299ed502
parent: 1b9907247d101dd82db6f84f0ba367a643aff2fa
author: Ali Gholami Rudi <ali@rudi.ir>
date: Sat Aug 30 15:42:02 EDT 2014
hyph: handle very long words in hyphenate()
--- a/hyph.c
+++ b/hyph.c
@@ -162,7 +162,7 @@
int di = 0, si = 0, len;
if (dots)
d[di++] = '.';
- while (s[si]) {
+ while (di < WORDLEN - GNLEN && s[si]) {
len = utf8len((unsigned char) s[si]);
map[di] = si;
memcpy(d + di, s + si, len);