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
This commit is contained in:
Chris Young 2010-04-29 23:05:52 +00:00
parent ce570ddde0
commit b579b0deb3

View File

@ -111,7 +111,7 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
*char_offset = length; *char_offset = length;
for(i=0;i<len;i++) for(i=0;i<=len;i++)
{ {
if (*utf16 < 0xD800 || 0xDFFF < *utf16) if (*utf16 < 0xD800 || 0xDFFF < *utf16)
utf16charlen = 1; utf16charlen = 1;
@ -120,10 +120,7 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
utf8len = utf8_char_byte_length(string); utf8len = utf8_char_byte_length(string);
if((i + 1) < len)
utf16next = utf16[utf16charlen]; utf16next = utf16[utf16charlen];
else
utf16next = 0;
if(ESetInfo(&ofont->olf_EEngine, if(ESetInfo(&ofont->olf_EEngine,
OT_GlyphCode, *utf16, OT_GlyphCode, *utf16,
@ -221,7 +218,7 @@ bool nsfont_split(const plot_font_style_t *fstyle,
*char_offset = 0; *char_offset = 0;
*actual_x = 0; *actual_x = 0;
for(i=0;i<len;i++) for(i=0;i<=len;i++)
{ {
utf8len = utf8_char_byte_length(string+utf8clen); utf8len = utf8_char_byte_length(string+utf8clen);
@ -230,10 +227,7 @@ bool nsfont_split(const plot_font_style_t *fstyle,
else else
utf16charlen = 2; utf16charlen = 2;
if((i + 1) < len)
utf16next = utf16[utf16charlen]; utf16next = utf16[utf16charlen];
else
utf16next = 0;
if(ESetInfo(&ofont->olf_EEngine, if(ESetInfo(&ofont->olf_EEngine,
OT_GlyphCode, *utf16, OT_GlyphCode, *utf16,
@ -354,17 +348,14 @@ ULONG ami_unicode_text(struct RastPort *rp,const char *string,ULONG length,const
dy++; dy++;
for(i=0;i<len;i++) for(i=0;i<=len;i++)
{ {
if (*utf16 < 0xD800 || 0xDFFF < *utf16) if (*utf16 < 0xD800 || 0xDFFF < *utf16)
utf16charlen = 1; utf16charlen = 1;
else else
utf16charlen = 2; utf16charlen = 2;
if((i + 1) < len)
utf16next = utf16[utf16charlen]; utf16next = utf16[utf16charlen];
else
utf16next = 0;
if(ESetInfo(&ofont->olf_EEngine, if(ESetInfo(&ofont->olf_EEngine,
OT_GlyphCode, *utf16, OT_GlyphCode, *utf16,