struct sfnt_table_directory *directory;
size_t offset, page, map_offset;
void *data;
- int i;
/* Find the table in the directory. */
- for (i = 0; i < subtable->num_tables; ++i)
+ for (int i = 0; ; i++)
{
- if (subtable->subtables[i].tag == tag)
- {
- directory = &subtable->subtables[i];
- break;
- }
+ if (! (i < subtable->num_tables))
+ return 1;
+ directory = &subtable->subtables[i];
+ if (directory->tag == tag)
+ break;
}
- if (i == subtable->num_tables)
- return 1;
-
/* Now try to map the glyph data. Make sure offset is a multiple of
the page size. */
{
struct sfnt_table_directory *directory;
void *data;
- int i;
/* Find the table in the directory. */
- for (i = 0; i < subtable->num_tables; ++i)
+ for (int i = 0; ; i++)
{
- if (subtable->subtables[i].tag == tag)
- {
- directory = &subtable->subtables[i];
- break;
- }
+ if (! (i < subtable->num_tables))
+ return NULL;
+ directory = &subtable->subtables[i];
+ if (directory->tag == tag)
+ break;
}
- if (i == subtable->num_tables)
- return NULL;
-
/* Seek to the table. */
if (lseek (fd, directory->offset, SEEK_SET) != directory->offset)
/* Copy in the shared point numbers instead. */
cvar->variation[i].num_points = npoints;
- if (npoints != UINT16_MAX)
+ if (points && npoints != UINT16_MAX)
{
if (cvar->variation[i].num_points > cvt->num_elements)
cvar->variation[i].num_points = cvt->num_elements;