From 666692882452510a650801d5ba567ab5ddc65029 Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 4 Apr 2021 22:01:25 +0000 Subject: [PATCH] Fix Windows build of menu.cpp Commit 6ad87cf78ab3 removed support for char[] as an input to nm_item_input and fixed all sites that used it in the cross-platform build. The Windows build has one use that no other platform does, and this use was not fixed. Fix it now. Fixes: 6ad87cf78ab369cdc26080ac579fb2ab3f592de6 ("Remove nm_set_item_input overload for char[]") --- similar/main/menu.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/similar/main/menu.cpp b/similar/main/menu.cpp index 510e34033..f891e3467 100644 --- a/similar/main/menu.cpp +++ b/similar/main/menu.cpp @@ -2248,17 +2248,17 @@ window_event_result browser::callback_handler(const d_event &event, window_event { if (event_key_get(event) == KEY_CTRLED + KEY_D) { - char text[4] = "c"; + std::array text{{"c"}}; int rval = 0; std::array m{{ nm_item_input(text), }}; rval = newmenu_do2(menu_title{nullptr}, menu_subtitle{"Enter drive letter"}, m, unused_newmenu_subfunction, unused_newmenu_userdata); - text[1] = '\0'; + const auto t0 = text[0]; std::array newpath; - snprintf(newpath.data(), newpath.size(), "%s:%s", text, sep); - if (!rval && text[0]) + snprintf(newpath.data(), newpath.size(), "%c:%s", t0, sep); + if (!rval && t0) { select_file_recursive(title, newpath, ext_range, select_dir, userdata); // close old box.