mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 16:58:17 +00:00
No OOM in msg_show_console_dialog()
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/ex_eval.h"
|
||||
#include "nvim/fileio.h"
|
||||
#include "nvim/func_attr.h"
|
||||
#include "nvim/getchar.h"
|
||||
#include "nvim/mbyte.h"
|
||||
#include "nvim/memory.h"
|
||||
@@ -2710,7 +2711,6 @@ do_dialog (
|
||||
++no_wait_return;
|
||||
hotkeys = msg_show_console_dialog(message, buttons, dfltbutton);
|
||||
|
||||
if (hotkeys != NULL) {
|
||||
for (;; ) {
|
||||
/* Get a typed character directly from the user. */
|
||||
c = get_keystroke();
|
||||
@@ -2753,7 +2753,6 @@ do_dialog (
|
||||
}
|
||||
|
||||
free(hotkeys);
|
||||
}
|
||||
|
||||
State = oldState;
|
||||
setmouse();
|
||||
@@ -2871,6 +2870,7 @@ static char_u * console_dialog_alloc(const char_u *message,
|
||||
* Returns an allocated string with hotkeys, or NULL for error.
|
||||
*/
|
||||
static char_u *msg_show_console_dialog(char_u *message, char_u *buttons, int dfltbutton)
|
||||
FUNC_ATTR_NONNULL_RET
|
||||
{
|
||||
bool has_hotkey[HAS_HOTKEY_LEN];
|
||||
char_u *hotk = console_dialog_alloc(message, buttons, has_hotkey);
|
||||
|
Reference in New Issue
Block a user