[sfnt] A refinement of the previous commit.

* src/sfnt/sfobjs.c (tt_name_entry_ascii_from_utf16,
tt_name_entry_ascii_from_other): Stop at null byte.
This commit is contained in:
Huw Davies 2012-03-14 18:29:57 +01:00 committed by Werner Lemberg
parent bf06b62a09
commit 3650f80165
2 changed files with 19 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2012-03-14 Huw Davies <huw@codeweavers.com>
[sfnt] A refinement of the previous commit.
* src/sfnt/sfobjs.c (tt_name_entry_ascii_from_utf16,
tt_name_entry_ascii_from_other): Stop at null byte.
2012-03-14 Huw Davies <huw@codeweavers.com> 2012-03-14 Huw Davies <huw@codeweavers.com>
[sfnt] Add `name' table compatibility to MS Windows. [sfnt] Add `name' table compatibility to MS Windows.

View File

@ -64,13 +64,17 @@
for ( n = 0; n < len; n++ ) for ( n = 0; n < len; n++ )
{ {
code = FT_NEXT_USHORT( read ); code = FT_NEXT_USHORT( read );
if ( code != 0 && ( code < 32 || code > 127 ) )
if ( code == 0 )
break;
if ( code < 32 || code > 127 )
code = '?'; code = '?';
string[n] = (char)code; string[n] = (char)code;
} }
string[len] = 0; string[n] = 0;
return string; return string;
} }
@ -95,13 +99,17 @@
for ( n = 0; n < len; n++ ) for ( n = 0; n < len; n++ )
{ {
code = *read++; code = *read++;
if ( code != 0 && ( code < 32 || code > 127 ) )
if ( code == 0 )
break;
if ( code < 32 || code > 127 )
code = '?'; code = '?';
string[n] = (char)code; string[n] = (char)code;
} }
string[len] = 0; string[n] = 0;
return string; return string;
} }