summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/menu.c b/menu.c
index 68f941a..3013920 100644
--- a/menu.c
+++ b/menu.c
@@ -60,12 +60,14 @@ static void menu_update(Ted *ted, Menu menu) {
case POPUP_NONE:
// no option selected
break;
- case POPUP_YES:
+ case POPUP_YES: {
// overwrite it!
- if (ted->prev_active_buffer)
- buffer_save_as(ted->prev_active_buffer, ted->warn_overwrite);
+ TextBuffer *buffer = ted->prev_active_buffer;
+ if (buffer) {
+ buffer_save_as(buffer, ted->warn_overwrite);
+ }
menu_close(ted, true);
- break;
+ } break;
case POPUP_NO:
// back to the file selector
*ted->warn_overwrite = '\0';