diff options
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r-- | src/nvim/message.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c index de4acd601f..3b3dfcd5b6 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -2514,7 +2514,7 @@ static void store_sb_text(char **sb_str, char *s, int attr, int *sb_col, int fin } if (s > *sb_str) { - mp = xmalloc((sizeof(msgchunk_T) + (size_t)(s - *sb_str))); + mp = xmalloc(offsetof(msgchunk_T, sb_text) + (size_t)(s - *sb_str) + 1); mp->sb_eol = (char)finish; mp->sb_msg_col = *sb_col; mp->sb_attr = attr; @@ -3006,7 +3006,7 @@ static int do_more_prompt(int typed_char) #if defined(MSWIN) /// Headless (no UI) error message handler. -static void do_msg(char *str, bool errmsg) +static void do_msg(const char *str, bool errmsg) { static bool did_err = false; assert(str != NULL); @@ -3026,13 +3026,13 @@ static void do_msg(char *str, bool errmsg) } } -void os_errmsg(char *str) +void os_errmsg(const char *str) { do_msg(str, true); } /// Headless (no UI) message handler. -void os_msg(char *str) +void os_msg(const char *str) { do_msg(str, false); } |