Fix crash when fallback font is not set and NetSurf was unable to find anything suitable on startup.

This commit is contained in:
Chris Young 2012-11-08 20:48:38 +00:00
parent 2a63ce87bb
commit 96ed2e65d9

View File

@ -1619,16 +1619,16 @@ void ami_gui_opts_use(bool save)
nsoption_set_charp(font_fantasy, (char *)strdup((char *)tattr->ta_Name));
GetAttr(GETFONT_TextAttr,gow->objects[GID_OPTS_FONT_UNICODE],(ULONG *)&data);
tattr = (struct TextAttr *)data;
if(tattr = (struct TextAttr *)data) {
if(dot = strrchr(tattr->ta_Name,'.')) *dot = '\0';
if(dot = strrchr(tattr->ta_Name,'.')) *dot = '\0';
if(strcmp(tattr->ta_Name, nsoption_charp(font_unicode)) != 0) {
rescan_fonts = true;
if(strcmp(tattr->ta_Name, nsoption_charp(font_unicode)) != 0) {
rescan_fonts = true;
}
nsoption_set_charp(font_unicode, (char *)strdup((char *)tattr->ta_Name));
}
nsoption_set_charp(font_unicode, (char *)strdup((char *)tattr->ta_Name));
GetAttr(CHOOSER_Selected,gow->objects[GID_OPTS_FONT_DEFAULT],(ULONG *)&nsoption_int(font_default));
nsoption_set_int(font_default, nsoption_int(font_default) + PLOT_FONT_FAMILY_SANS_SERIF);