[hackers] [sent] die if no font could be loaded || Markus Teich

From: <git_AT_suckless.org>
Date: Wed, 18 Nov 2015 00:39:28 +0100 (CET)

commit cc57a28eba7c2ec574d92817bff012b3b051dd6b
Author: Markus Teich <markus.teich_AT_stusta.mhn.de>
AuthorDate: Wed Nov 18 00:41:38 2015 +0100
Commit: Markus Teich <markus.teich_AT_stusta.mhn.de>
CommitDate: Wed Nov 18 00:41:38 2015 +0100

    die if no font could be loaded

diff --git a/sent.c b/sent.c
index 4e2e810..e68051f 100644
--- a/sent.c
+++ b/sent.c
_AT_@ -616,7 +616,8 @@ void xloadfonts()
                         if (MAXFONTSTRLEN < snprintf(fstrs[j], MAXFONTSTRLEN, "%s:size=%d", fontfallbacks[j], FONTSZ(i)))
                                 die("font string too long");
                 }
- fonts[i] = drw_fontset_create(d, (const char**)fstrs, LEN(fstrs));
+ if (!(fonts[i] = drw_fontset_create(d, (const char**)fstrs, LEN(fstrs))))
+ die("unable to load any font for size %d", FONTSZ(i));
         }
 
         for (j = 0; j < LEN(fontfallbacks); j++)
Received on Wed Nov 18 2015 - 00:39:28 CET

This archive was generated by hypermail 2.3.0 : Wed Nov 18 2015 - 00:48:17 CET