From 734ac625bb320bb260a745b0bcb506e16a0c21ab Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Thu, 4 Dec 2014 10:05:54 +0100 Subject: Fix warnings: message.c: msg_attr_keep(): Np dereference: FP. Problem : Dereference of null pointer @ 179. Diagnostic : False positive. Rationale : Error occurs if `s` paramater is null, which should not happen. Resolution : Declare parameter as non null. --- src/nvim/message.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nvim/message.c') diff --git a/src/nvim/message.c b/src/nvim/message.c index cd0c548fb4..5832b2e7cb 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -145,7 +145,7 @@ int verb_msg(char_u *s) return n; } -int msg_attr(char_u *s, int attr) +int msg_attr(char_u *s, int attr) FUNC_ATTR_NONNULL_ARG(1) { return msg_attr_keep(s, attr, FALSE); } @@ -156,6 +156,7 @@ msg_attr_keep ( int attr, int keep /* TRUE: set keep_msg if it doesn't scroll */ ) + FUNC_ATTR_NONNULL_ARG(1) { static int entered = 0; int retval; @@ -2623,7 +2624,7 @@ int verbose_open(void) * Give a warning message (for searching). * Use 'w' highlighting and may repeat the message after redrawing */ -void give_warning(char_u *message, bool hl) +void give_warning(char_u *message, bool hl) FUNC_ATTR_NONNULL_ARG(1) { /* Don't do this for ":silent". */ if (msg_silent != 0) -- cgit