xbm.c: refactor and load builtin icons as fallback

This commit is contained in:
Johan Malm 2020-07-13 20:09:34 +01:00
parent 1330071e0c
commit 8a42bc9184
6 changed files with 86 additions and 63 deletions

View file

@ -91,10 +91,8 @@ char *xbm_read_file(const char *filename)
char *line = NULL;
size_t len = 0;
FILE *stream = fopen(filename, "r");
if (!stream) {
fprintf(stderr, "warn: cannot read '%s'\n", filename);
if (!stream)
return NULL;
}
struct buf buffer;
buf_init(&buffer);
while ((getline(&line, &len, stream) != -1)) {