mirror of https://github.com/freetype/freetype
[bdf] Use concise macros.
* src/bdf/bdflib.c (bdf_create_property): Use FT_STRDUP. (bdf_parse_glyphs_, bdf_parse_start_): Use FT_DUP for brevity.
This commit is contained in:
parent
026fd5d4f0
commit
b25265fe55
|
@ -864,15 +864,9 @@
|
|||
|
||||
p = font->user_props + font->nuser_props;
|
||||
|
||||
n = ft_strlen( name ) + 1;
|
||||
if ( n > FT_LONG_MAX )
|
||||
return FT_THROW( Invalid_Argument );
|
||||
|
||||
if ( FT_QALLOC( p->name, n ) )
|
||||
if ( FT_STRDUP( p->name, name ) )
|
||||
goto Exit;
|
||||
|
||||
FT_MEM_COPY( (char *)p->name, name, n );
|
||||
|
||||
p->format = format;
|
||||
p->builtin = 0;
|
||||
p->value.atom = NULL; /* nothing is ever stored here */
|
||||
|
@ -1442,11 +1436,9 @@
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
if ( FT_QALLOC( p->glyph_name, slen + 1 ) )
|
||||
if ( FT_DUP( p->glyph_name, s, slen + 1 ) )
|
||||
goto Exit;
|
||||
|
||||
FT_MEM_COPY( p->glyph_name, s, slen + 1 );
|
||||
|
||||
p->flags |= BDF_GLYPH_;
|
||||
|
||||
FT_TRACE4(( DBGMSG1, lineno, s ));
|
||||
|
@ -2051,9 +2043,8 @@
|
|||
/* Allowing multiple `FONT' lines (which is invalid) doesn't hurt... */
|
||||
FT_FREE( p->font->name );
|
||||
|
||||
if ( FT_QALLOC( p->font->name, slen + 1 ) )
|
||||
if ( FT_DUP( p->font->name, s, slen + 1 ) )
|
||||
goto Exit;
|
||||
FT_MEM_COPY( p->font->name, s, slen + 1 );
|
||||
|
||||
/* If the font name is an XLFD name, set the spacing to the one in */
|
||||
/* the font name. If there is no spacing fall back on the default. */
|
||||
|
|
Loading…
Reference in New Issue