From: Francois Fleuret Date: Sun, 28 Jun 2009 10:18:16 +0000 (+0200) Subject: Added the fclose() for the input files. X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=selector.git;a=commitdiff_plain;h=298604bb3dcb60332e37ae3b66b746bad249e1ca Added the fclose() for the input files. --- diff --git a/selector.c b/selector.c index 1923b7a..2880b5f 100644 --- a/selector.c +++ b/selector.c @@ -367,14 +367,14 @@ void update_screen(int *current_focus_line, int *displayed_focus_line, int console_width = getmaxx(stdscr); int console_height = getmaxy(stdscr); - /* First, we find a visible line. */ - int nb_printed_lines = 0; use_default_colors(); addstr("\n"); + /* First, we find a visible line. */ + if(matcher.regexp_error) { attron(attr_error); addnstr("Regexp syntax error", console_width); @@ -604,7 +604,7 @@ void read_file(const char *input_filename, if(eol == buffer_size) { raw_line[buffer_size - 1] = '\0'; - fprintf(stderr, "Line too long:\n"); + fprintf(stderr, "Line too long (max is %d characters):\n", buffer_size); fprintf(stderr, raw_line); fprintf(stderr, "\n"); exit(1); @@ -654,6 +654,8 @@ void read_file(const char *input_filename, start = eol + 1; } + + fclose(file); } /*********************************************************************/