From 1cae99b4bf6517d559ff222b968c314198923260 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 2 Dec 2017 18:55:54 +0100 Subject: msg_outtrans_special(): handle NULL This is convenient for terminfo_info_msg(). --- src/nvim/message.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nvim/message.c b/src/nvim/message.c index 907a2472c8..5c8f0655bf 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1254,11 +1254,13 @@ int msg_outtrans_special( int from ///< true for LHS of a mapping ) { + if (strstart == NULL) { + return 0; // Do nothing. + } const char_u *str = strstart; int retval = 0; - int attr; + int attr = hl_attr(HLF_8); - attr = hl_attr(HLF_8); while (*str != NUL) { const char *string; // Leading and trailing spaces need to be displayed in <> form. -- cgit