diff --git a/kilo.c b/kilo.c index d1f663d..bf63252 100644 --- a/kilo.c +++ b/kilo.c @@ -1,5 +1,9 @@ /*** includes ***/ +#define _DEFAULT_SOURCE +#define _BSD_SOURCE +#define _GNU_SOURCE + #include #include #include @@ -285,7 +289,7 @@ void editorDrawRows(struct abuf *ab) { int y; for (y = 0; y < E.screenrows; y++) { if (y >= E.numrows) { - if (y == E.screenrows / 3) { + if (E.numrows == 0 && y == E.screenrows / 3) { char welcome[80]; int welcomelen = snprintf(welcome, sizeof(welcome), "Kilo editor -- version %s", KILO_VERSION);