Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

tighten up some boundary cases

  • Loading branch information...
commit 20bcd11b05ea9b800fb4f5bd8813be3558b90fdc 1 parent c3af61f
@mskala mskala authored
Showing with 4 additions and 4 deletions.
  1. +3 −3 fontforge/fontviewbase.c
  2. +1 −1  fontforge/sfd.c
View
6 fontforge/fontviewbase.c
@@ -1475,13 +1475,13 @@ void FVRemoveUnused(FontViewBase *fv) {
int gid, i;
int flags = -1;
- for ( i=map->enccount-1; i>=0 && ((gid=map->map[i])==-1 || !SCWorthOutputting(sf->glyphs[gid]));
+ for ( i=map->enccount-1;
+ i>=map->enc->char_cnt &&
+ ((gid=map->map[i])==-1 || !SCWorthOutputting(sf->glyphs[gid]));
--i ) {
if ( gid!=-1 )
SFRemoveGlyph(sf,sf->glyphs[gid],&flags);
map->enccount = i;
- if ( map->enccount==map->enc->char_cnt )
- break;
}
/* We reduced the encoding, so don't really need to reallocate the selection */
/* array. It's just bigger than it needs to be. */
View
2  fontforge/sfd.c
@@ -8042,7 +8042,7 @@ exit( 1 );
} else if ( strmatch(tok,"BeginChars:")==0 ) {
int charcnt;
getint(sfd,&charcnt);
- if (charcnt<enc->char_cnt && enc->char_cnt>0) {
+ if (charcnt<enc->char_cnt) {
IError("SFD file specifies too few slots for its encoding.\n" );
exit( 1 );
}
Please sign in to comment.
Something went wrong with that request. Please try again.