diff options
author | Oskar <[email protected]> | 2024-02-10 23:17:40 +0100 |
---|---|---|
committer | Oskar <[email protected]> | 2024-02-10 23:17:40 +0100 |
commit | 6d15b3fc79e01fea1db05a6906596798fee4beaa (patch) | |
tree | aac5a3d7d6bc248fce7e07904fb7ba0e63ac3b2d /editmode.c | |
parent | 03f53f231f0708b9f9f74302554a5d7d982aaa21 (diff) |
Makefile changes and slight change to variable in startmode.c
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 +} |