aboutsummaryrefslogtreecommitdiff
path: root/freetype/src/sfnt
diff options
context:
space:
mode:
Diffstat (limited to 'freetype/src/sfnt')
-rw-r--r--freetype/src/sfnt/sfobjs.c14
-rw-r--r--freetype/src/sfnt/ttcmap.c2
-rw-r--r--freetype/src/sfnt/ttcmap.h6
-rw-r--r--freetype/src/sfnt/ttload.c15
-rw-r--r--freetype/src/sfnt/ttmtx.c4
5 files changed, 24 insertions, 17 deletions
diff --git a/freetype/src/sfnt/sfobjs.c b/freetype/src/sfnt/sfobjs.c
index d7be631af..2bc4bd930 100644
--- a/freetype/src/sfnt/sfobjs.c
+++ b/freetype/src/sfnt/sfobjs.c
@@ -4,7 +4,7 @@
/* */
/* SFNT object management (base). */
/* */
-/* Copyright 1996-2008, 2010-2011 by */
+/* Copyright 1996-2008, 2010-2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -64,13 +64,17 @@
for ( n = 0; n < len; n++ )
{
code = FT_NEXT_USHORT( read );
+
+ if ( code == 0 )
+ break;
+
if ( code < 32 || code > 127 )
code = '?';
string[n] = (char)code;
}
- string[len] = 0;
+ string[n] = 0;
return string;
}
@@ -95,13 +99,17 @@
for ( n = 0; n < len; n++ )
{
code = *read++;
+
+ if ( code == 0 )
+ break;
+
if ( code < 32 || code > 127 )
code = '?';
string[n] = (char)code;
}
- string[len] = 0;
+ string[n] = 0;
return string;
}
diff --git a/freetype/src/sfnt/ttcmap.c b/freetype/src/sfnt/ttcmap.c
index 544750ab1..1dfd9876f 100644
--- a/freetype/src/sfnt/ttcmap.c
+++ b/freetype/src/sfnt/ttcmap.c
@@ -3363,7 +3363,7 @@
return error;
/* the location of the class instances follows the array of pointers */
- recs = (TT_CMap_ClassRec*) (((char*)clazz)+(sizeof(*clazz)*(i+1)));
+ recs = (TT_CMap_ClassRec*) (((char*)clazz)+(sizeof(*clazz)*(i+1)));
i=0;
#undef TTCMAPCITEM
diff --git a/freetype/src/sfnt/ttcmap.h b/freetype/src/sfnt/ttcmap.h
index 15a4a21e5..94f797897 100644
--- a/freetype/src/sfnt/ttcmap.h
+++ b/freetype/src/sfnt/ttcmap.h
@@ -70,7 +70,7 @@ FT_BEGIN_HEADER
format_, validate_, get_cmap_info_ \
};
-#else /* FT_CONFIG_OPTION_PIC */
+#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_TT_CMAP(class_, size_, init_, done_, char_index_, \
char_next_, char_var_index_, char_var_default_, variant_list_, \
@@ -92,9 +92,9 @@ FT_BEGIN_HEADER
clazz->format = format_; \
clazz->validate = validate_; \
clazz->get_cmap_info = get_cmap_info_; \
- }
+ }
-#endif /* FT_CONFIG_OPTION_PIC */
+#endif /* FT_CONFIG_OPTION_PIC */
typedef struct TT_ValidatorRec_
{
diff --git a/freetype/src/sfnt/ttload.c b/freetype/src/sfnt/ttload.c
index 5fb9aea4e..2beb57b67 100644
--- a/freetype/src/sfnt/ttload.c
+++ b/freetype/src/sfnt/ttload.c
@@ -5,8 +5,7 @@
/* Load the basic TrueType tables, i.e., tables that can be either in */
/* TTF or OTF fonts (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
-/* 2010 by */
+/* Copyright 1996-2010, 2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -624,7 +623,7 @@
FT_Error error;
TT_MaxProfile* maxProfile = &face->max_profile;
- const FT_Frame_Field maxp_fields[] =
+ static const FT_Frame_Field maxp_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE TT_MaxProfile
@@ -635,7 +634,7 @@
FT_FRAME_END
};
- const FT_Frame_Field maxp_fields_extra[] =
+ static const FT_Frame_Field maxp_fields_extra[] =
{
FT_FRAME_START( 26 ),
FT_FRAME_USHORT( maxPoints ),
@@ -721,7 +720,7 @@
/*************************************************************************/
/* */
/* <Function> */
- /* tt_face_load_names */
+ /* tt_face_load_name */
/* */
/* <Description> */
/* Loads the name records. */
@@ -952,7 +951,7 @@
FT_Error error;
TT_OS2* os2;
- const FT_Frame_Field os2_fields[] =
+ static const FT_Frame_Field os2_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE TT_OS2
@@ -1004,7 +1003,7 @@
FT_FRAME_END
};
- const FT_Frame_Field os2_fields_extra[] =
+ static const FT_Frame_Field os2_fields_extra[] =
{
FT_FRAME_START( 8 ),
FT_FRAME_ULONG( ulCodePageRange1 ),
@@ -1012,7 +1011,7 @@
FT_FRAME_END
};
- const FT_Frame_Field os2_fields_extra2[] =
+ static const FT_Frame_Field os2_fields_extra2[] =
{
FT_FRAME_START( 10 ),
FT_FRAME_SHORT ( sxHeight ),
diff --git a/freetype/src/sfnt/ttmtx.c b/freetype/src/sfnt/ttmtx.c
index 73ac8b2d5..8f7b2a93b 100644
--- a/freetype/src/sfnt/ttmtx.c
+++ b/freetype/src/sfnt/ttmtx.c
@@ -4,7 +4,7 @@
/* */
/* Load the metrics tables common to TTF and OTF fonts (body). */
/* */
-/* Copyright 2006-2009, 2011 by */
+/* Copyright 2006-2009, 2011-2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -260,7 +260,7 @@
FT_Error error;
TT_HoriHeader* header;
- const FT_Frame_Field metrics_header_fields[] =
+ static const FT_Frame_Field metrics_header_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE TT_HoriHeader