diff options
Diffstat (limited to 'editmode.c')
-rw-r--r-- | editmode.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -242,7 +242,10 @@ int editmode(char filename[], long focus) { // the editing interface char editbuffer[BUF_SZ_2]; fprintf(stdout, "(%ld EDIT): ", focus); - fgets(editbuffer, BUF_SZ_2, stdin); + char *fgs = fgets(editbuffer, BUF_SZ_2, stdin); + if (fgs == NULL) { + return 0; + } if (editbuffer[0] == '\n') { fprintf(stdout, "No changes\n"); @@ -265,4 +268,4 @@ int editmode(char filename[], long focus) { // the editing interface return EXIT_SUCCESS; -}
\ No newline at end of file +} |