src/keybind.c: move keybind_print() to dbg.c

This commit is contained in:
Johan Malm 2020-06-18 20:39:55 +01:00
parent 7440919452
commit f6578248c0
6 changed files with 14 additions and 16 deletions

View file

@ -85,14 +85,13 @@ void theme_read(const char *filename)
FILE *stream;
char *line = NULL;
size_t len = 0;
ssize_t n_read;
stream = fopen(filename, "r");
if (!stream) {
fprintf(stderr, "warn: cannot read '%s'\n", filename);
return;
}
while ((n_read = getline(&line, &len, stream) != -1)) {
while (getline(&line, &len, stream) != -1) {
char *p = strrchr(line, '\n');
if (p)
*p = '\0';