summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2010-04-29 23:05:52 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2010-04-29 23:05:52 +0000
commitb579b0deb39c067f19bebcb4acfb29d7ef87f258 (patch)
tree56c417f69255410a82d564db1f2f42f8306a5538 /amiga
parentce570ddde0ca839a3ebbb2b0ed449cd1500d5752 (diff)
downloadnetsurf-b579b0deb39c067f19bebcb4acfb29d7ef87f258.tar.gz
netsurf-b579b0deb39c067f19bebcb4acfb29d7ef87f258.tar.bz2
Don't check if the next character is outside the printable string, if it is it'll pick
up the NULL terminator anyway. svn path=/trunk/netsurf/; revision=10523
Diffstat (limited to 'amiga')
-rw-r--r--amiga/font.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/amiga/font.c b/amiga/font.c
index 95c8a47af..67d65cdde 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -111,7 +111,7 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
*char_offset = length;
- for(i=0;i<len;i++)
+ for(i=0;i<=len;i++)
{
if (*utf16 < 0xD800 || 0xDFFF < *utf16)
utf16charlen = 1;
@@ -120,10 +120,7 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
utf8len = utf8_char_byte_length(string);
- if((i + 1) < len)
- utf16next = utf16[utf16charlen];
- else
- utf16next = 0;
+ utf16next = utf16[utf16charlen];
if(ESetInfo(&ofont->olf_EEngine,
OT_GlyphCode, *utf16,
@@ -221,7 +218,7 @@ bool nsfont_split(const plot_font_style_t *fstyle,
*char_offset = 0;
*actual_x = 0;
- for(i=0;i<len;i++)
+ for(i=0;i<=len;i++)
{
utf8len = utf8_char_byte_length(string+utf8clen);
@@ -230,10 +227,7 @@ bool nsfont_split(const plot_font_style_t *fstyle,
else
utf16charlen = 2;
- if((i + 1) < len)
- utf16next = utf16[utf16charlen];
- else
- utf16next = 0;
+ utf16next = utf16[utf16charlen];
if(ESetInfo(&ofont->olf_EEngine,
OT_GlyphCode, *utf16,
@@ -354,17 +348,14 @@ ULONG ami_unicode_text(struct RastPort *rp,const char *string,ULONG length,const
dy++;
- for(i=0;i<len;i++)
+ for(i=0;i<=len;i++)
{
if (*utf16 < 0xD800 || 0xDFFF < *utf16)
utf16charlen = 1;
else
utf16charlen = 2;
- if((i + 1) < len)
- utf16next = utf16[utf16charlen];
- else
- utf16next = 0;
+ utf16next = utf16[utf16charlen];
if(ESetInfo(&ofont->olf_EEngine,
OT_GlyphCode, *utf16,