From: khamidou Date: Thu, 26 Nov 2009 20:19:58 +0000 (+0100) Subject: fixed out of memory condition X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=89aaef421e46d5bb9c1bf22db43d99f8fc44ab07;p=te.git fixed out of memory condition --- diff --git a/main.c b/main.c index c6f70fe..c66cc88 100644 --- a/main.c +++ b/main.c @@ -16,14 +16,17 @@ extern struct te_buffer *current_buf; int main(int argc, char **argv) { + + if (argc <= 1) + cmdline_help(); + init_windows(); init_buffers(); - if (argc > 1) - for (argv++; *argv != NULL ; argv++) - current_buf = load_buffer(*argv); - else - cmdline_help(); + for (argv++; *argv != NULL ; argv++) + current_buf = load_buffer(*argv); + + paint_buffer(current_buf); statusprintf("%s", current_buf->name); diff --git a/screen.c b/screen.c index 5149c91..3d03f81 100644 --- a/screen.c +++ b/screen.c @@ -60,6 +60,7 @@ void paint_buffer_nlines(struct te_buffer *buf, int nlines) draw_line(s, i); count += blength(s); + bdestroy(s); if (count >= blength(buf->contents)) break; }