From 6a883fcd23724e30cf0a360f45e50435e49ce8cb Mon Sep 17 00:00:00 2001 From: David Turner Date: Tue, 26 Mar 2002 02:38:39 +0000 Subject: [PATCH] fixed a small bug in FT_CMaps support --- ChangeLog | 5 +++++ src/sfnt/sfdriver.c | 7 +++---- src/sfnt/sfobjs.c | 6 +++--- src/sfnt/ttcmap0.c | 15 +++++++-------- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd1816e28..d09126339 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-03-26 David Turner + + * src/sfnt/sfdriver.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c: + fixed a small bug in the FT_CMaps support code + 2002-03-22 David Turner * src/base/ftobjs.c, src/sfnt/ttcmap0.c, src/type1/t1objs.c: diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c index cc291e83a..c69802263 100644 --- a/src/sfnt/sfdriver.c +++ b/src/sfnt/sfdriver.c @@ -174,12 +174,11 @@ TT_NameEntryRec* name = face->name_table.names + found_win; FT_UInt len = name->stringLength; FT_Error error; - FT_String* result; - + if ( !FT_ALLOC( result, len+1 ) ) { - FT_MEM_COPY( result, name->string, len ); - result[len] = '\0'; + FT_MEM_COPY( (char*)result, name->string, len ); + ((char*)result)[len] = '\0'; } goto Exit; } diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index 25030afa8..5d866ee43 100644 --- a/src/sfnt/sfobjs.c +++ b/src/sfnt/sfobjs.c @@ -461,11 +461,11 @@ /* set the encoding fields */ { - FT_Int n; + FT_Int m; - for ( n = 0; n < root->num_charmaps; n++ ) + for ( m = 0; m < root->num_charmaps; m++ ) { - FT_CharMap charmap = root->charmaps[n]; + FT_CharMap charmap = root->charmaps[m]; charmap->encoding = sfnt_find_encoding( charmap->platform_id, charmap->encoding_id ); diff --git a/src/sfnt/ttcmap0.c b/src/sfnt/ttcmap0.c index 7932db204..e3004e25e 100644 --- a/src/sfnt/ttcmap0.c +++ b/src/sfnt/ttcmap0.c @@ -144,7 +144,7 @@ FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec tt_cmap0_class_rec = { { - sizeof( FT_CMapRec ), + sizeof( TT_CMapRec ), (FT_CMap_InitFunc) tt_cmap_init, (FT_CMap_DoneFunc) NULL, @@ -488,7 +488,7 @@ FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec tt_cmap2_class_rec = { { - sizeof( FT_CMapRec ), + sizeof( TT_CMapRec ), (FT_CMap_InitFunc) tt_cmap_init, (FT_CMap_DoneFunc) NULL, @@ -817,7 +817,7 @@ FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec tt_cmap4_class_rec = { { - sizeof( FT_CMapRec ), + sizeof( TT_CMapRec ), (FT_CMap_InitFunc) tt_cmap_init, (FT_CMap_DoneFunc) NULL, @@ -957,7 +957,7 @@ FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec tt_cmap6_class_rec = { { - sizeof( FT_CMapRec ), + sizeof( TT_CMapRec ), (FT_CMap_InitFunc) tt_cmap_init, (FT_CMap_DoneFunc) NULL, @@ -1150,8 +1150,7 @@ FT_CALLBACK_DEF( FT_UInt ) tt_cmap8_char_next( TT_CMap cmap, - FT_UInt32 *pchar_code, - FT_UInt *agindex ) + FT_UInt32 *pchar_code ) { FT_UInt32 result = 0; FT_UInt32 char_code = *pchar_code + 1; @@ -1192,7 +1191,7 @@ FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec tt_cmap8_class_rec = { { - sizeof( FT_CMapRec ), + sizeof( TT_CMapRec ), (FT_CMap_InitFunc) tt_cmap_init, (FT_CMap_DoneFunc) NULL, @@ -1323,7 +1322,7 @@ FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec tt_cmap10_class_rec = { { - sizeof( FT_CMapRec ), + sizeof( TT_CMapRec ), (FT_CMap_InitFunc) tt_cmap_init, (FT_CMap_DoneFunc) NULL,