From c4430cf14f72b5e9e4a776376ff68125342fcd50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Nephtali?= Date: Sat, 15 Apr 2017 16:49:23 +0200 Subject: [PATCH] Fix fopen() mode Use r+ instead of a+ which makes more sense since it needs to read from the beginning of the file. --- tte.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tte.c b/tte.c index 833eec4..383325f 100644 --- a/tte.c +++ b/tte.c @@ -1067,7 +1067,7 @@ void editorOpen(char* file_name) { editorSelectSyntaxHighlight(); - FILE* file = fopen(file_name, "a+"); + FILE* file = fopen(file_name, "r+"); if (!file) die("Failed to open the file");