sex

simple editor extended using libtermbox
git clone git://z3bra.org/sex
Log | Files | Refs | README

commit aa6e1c2e0b096ce764e3d97b920de7944975b93a
parent 9e6662fa43f6c1c6620b72a70a6e7e670beb56e8
Author: dcat <dcat@iotek.org>
Date:   Thu Nov 19 15:28:11 2015

use err()

Diffstat:
 sex.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sex.c b/sex.c @@ -78,10 +78,9 @@ open_file(char *path) for (i = last_eol = 0; i < f.size; ++i) { if (*(f.map + i) == '\n') { tmp = malloc(sizeof(*tmp)); - if (tmp == NULL) { - perror("malloc failed"); - exit(1); - } + if (tmp == NULL) + err(1, "malloc()"); + tmp->p = f.map + last_eol; tmp->len = i - last_eol + 1; last_eol = i + 1;