summaryrefslogtreecommitdiff
path: root/editmode.c
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-02-10 23:17:40 +0100
committerOskar <[email protected]>2024-02-10 23:17:40 +0100
commit6d15b3fc79e01fea1db05a6906596798fee4beaa (patch)
treeaac5a3d7d6bc248fce7e07904fb7ba0e63ac3b2d /editmode.c
parent03f53f231f0708b9f9f74302554a5d7d982aaa21 (diff)
Makefile changes and slight change to variable in startmode.c
Diffstat (limited to 'editmode.c')
-rw-r--r--editmode.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/editmode.c b/editmode.c
index 2fb40b2..938bb5a 100644
--- a/editmode.c
+++ b/editmode.c
@@ -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
+}