aboutsummaryrefslogtreecommitdiffstats
path: root/fbi.c
diff options
context:
space:
mode:
authorkraxel <kraxel>2004-06-15 20:19:59 +0000
committerkraxel <kraxel>2004-06-15 20:19:59 +0000
commitb6a435badc8d2cd793a7605e43d2787841b2bf75 (patch)
tree0b9bbb0bb2d9da765cadc0bd8e333fc86ce29c63 /fbi.c
parent786cf865080ac907b75fbe74ead290fff9efb718 (diff)
downloadfbida-b6a435badc8d2cd793a7605e43d2787841b2bf75.tar.gz
- fix segfault on font open failure.
Diffstat (limited to 'fbi.c')
-rw-r--r--fbi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fbi.c b/fbi.c
index db4057a..f666994 100644
--- a/fbi.c
+++ b/fbi.c
@@ -1167,7 +1167,13 @@ main(int argc, char *argv[])
need_read = 1;
font_init();
- face = font_open(fontname ? fontname : "monospace:size=16");
+ if (NULL == fontname)
+ fontname = "monospace:size=16";
+ face = font_open(fontname);
+ if (NULL == face) {
+ fprintf(stderr,"can't open font: %s\n",fontname);
+ exit(1);
+ }
fd = fb_init(cfg_get_str(O_DEVICE),
cfg_get_str(O_VIDEO_MODE),
GET_VT());