summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-03-20 13:14:17 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2013-03-20 13:14:17 +0000
commitea4b7eb3a87f99e8245c71eb46c8f6ff545ac204 (patch)
tree5f6654dc535b86a0c868a51d128c7d1cc4100aeb
parent8cfa964cdf889ce80517ecf0e1fac708baea7837 (diff)
downloadnetsurf-ea4b7eb3a87f99e8245c71eb46c8f6ff545ac204.tar.gz
netsurf-ea4b7eb3a87f99e8245c71eb46c8f6ff545ac204.tar.bz2
Try fixing Amiga nsfont_split. (Untested!)
-rw-r--r--amiga/font.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/amiga/font.c b/amiga/font.c
index a6f2daf4a..620d56d53 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -261,7 +261,7 @@ bool nsfont_split(const plot_font_style_t *fstyle,
*char_offset = 0;
*actual_x = 0;
- while(utf8clen <= length) {
+ while(utf8clen < length) {
utf8len = utf8_char_byte_length(string + utf8clen);
if ((*utf16 < 0xD800) || (0xDFFF < *utf16))
@@ -297,11 +297,10 @@ bool nsfont_split(const plot_font_style_t *fstyle,
if((x < tx) && (coffset != 0)) {
/* We've run out of space, and a space has been found, split there. */
break;
- } else {
- if((*utf16 == 0x0020) || (utf8clen == length)) {
- *actual_x = tx;
- coffset = utf8clen;
- }
+
+ } else if (*utf16 == 0x0020) {
+ *actual_x = tx;
+ coffset = utf8clen;
}
utf16 += utf16charlen;
utf8clen += utf8len;