#endif /* DEBUG */
if (!XftInit(0)) {
g_warning(_("Couldn't initialize Xft.\n"));
- exit(3);
+ exit(EXIT_FAILURE);
}
#ifdef DEBUG
version = XftGetVersion();
return out;
}
g_warning(_("Unable to load font: %s\n"), "sans");
- g_warning(_("Aborting!.\n"));
- exit(3); /* can't continue without a font */
+ return NULL;
}
void RrFontClose(RrFont *f)
gchar *font_str;
RrTheme *theme;
- theme = g_new(RrTheme, 1);
+ theme = g_new0(RrTheme, 1);
theme->inst = inst;
theme->winfont_shadow_tint < 100 || theme->winfont_shadow_tint > 100)
theme->winfont_shadow_tint = 25;
- theme->winfont = RrFontOpen(inst, font_str);
+ if (!(theme->winfont = RrFontOpen(inst, font_str))) {
+ RrThemeFree(theme);
+ return NULL;
+ }
theme->winfont_height = RrFontHeight(theme->winfont, theme->winfont_shadow,
theme->winfont_shadow_offset);
theme->mtitlefont_shadow_tint > 100)
theme->mtitlefont_shadow_tint = 25;
- theme->mtitlefont = RrFontOpen(inst, font_str);
+ if (!(theme->mtitlefont = RrFontOpen(inst, font_str))) {
+ RrThemeFree(theme);
+ return NULL;
+ }
theme->mtitlefont_height = RrFontHeight(theme->mtitlefont,
theme->mtitlefont_shadow,
theme->mtitlefont_shadow_offset);
theme->mfont_shadow_tint > 100)
theme->mfont_shadow_tint = 25;
- theme->mfont = RrFontOpen(inst, font_str);
+ if (!(theme->mfont = RrFontOpen(inst, font_str))) {
+ RrThemeFree(theme);
+ return NULL;
+ }
theme->mfont_height = RrFontHeight(theme->mfont, theme->mfont_shadow,
theme->mfont_shadow_offset);