fixed fatal() call endwin() after noraw(), free curbp and scrap on exit of main.

This commit is contained in:
Hugh Barney 2017-04-11 20:07:57 +01:00
parent 4b384b1742
commit e266221618

7
zep.c
View File

@ -15,7 +15,7 @@
#include <termios.h> #include <termios.h>
#define E_NAME "zep" #define E_NAME "zep"
#define E_VERSION "v1.2" #define E_VERSION "v1.3"
#define E_LABEL "Zep:" #define E_LABEL "Zep:"
#define B_MODIFIED 0x01 /* modified buffer */ #define B_MODIFIED 0x01 /* modified buffer */
@ -99,8 +99,8 @@ void fatal(char *msg)
{ {
move(LINES-1, 0); move(LINES-1, 0);
refresh(); refresh();
endwin();
noraw(); noraw();
endwin();
printf("\n" E_NAME " " E_VERSION ": %s\n", msg); printf("\n" E_NAME " " E_VERSION ": %s\n", msg);
exit(1); exit(1);
} }
@ -752,6 +752,9 @@ int main(int argc, char **argv)
} }
} }
if (scrap != NULL) free(scrap);
if (curbp != NULL) free(curbp);
move(MSGLINE, 0); move(MSGLINE, 0);
refresh(); refresh();
noraw(); noraw();