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
1 changed files with 5 additions and 2 deletions

7
zep.c
View File

@ -15,7 +15,7 @@
#include <termios.h>
#define E_NAME "zep"
#define E_VERSION "v1.2"
#define E_VERSION "v1.3"
#define E_LABEL "Zep:"
#define B_MODIFIED 0x01 /* modified buffer */
@ -99,8 +99,8 @@ void fatal(char *msg)
{
move(LINES-1, 0);
refresh();
endwin();
noraw();
endwin();
printf("\n" E_NAME " " E_VERSION ": %s\n", msg);
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);
refresh();
noraw();