diff options
author | ache <ache@ache.one> | 2020-09-11 14:26:21 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2020-09-11 14:26:21 +0200 |
commit | 480341b3cd1370c32973a5f1ec320e996aab8989 (patch) | |
tree | c82f0b0f75af56a89b3b9d8fa513b7d8b25712cf | |
parent | 🎨 Style fix (diff) |
-rw-r--r-- | main.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -436,7 +436,6 @@ int main(int argc, char* argv[]){ edit: system(cmd); - free(cmd); { FILE* r = fopen(fileName,"r"); FILE* t = tmpfile(); @@ -474,7 +473,6 @@ edit: } char* string = malloc( nb+1 ); fclose(r); - unlink( fileName ); rewind(t); nb = 0; while( (c = fgetc(t)) != EOF ) { @@ -507,6 +505,9 @@ edit: goto edit; } } + // You must do it now because it can be used by the goto + unlink( fileName ); + free(cmd); resize(); } case KEY_HOME: |