> On Wed, Jun 1, 2022 at 4:33 AM Bram Moolenaar <[email protected]>
> wrote:
> 
> > Not sure why you remove that check for NULL, theoretically it can happen
> > if the string value is NULL.
>
> I removed the NULL check because it is redundant and will never be hit.
> The pointer is validated just before this check in the if-else block.

That is true for the "else" block.  The code is confusing, since it
checks the value of "end", while the value of "p" is actually used.
"end" is overwritten by the call to event_name2nr().

In the "if" block there is this:
         p = eli->li_tv.vval.v_string;

A string may have a NULL value.  Oh, that is actually checked just
above.

Let me change that to make it clearer, and also to avoid a compiler
warning for uninitialized variable.

-- 
There are 2 kinds of people in my world: those who know Unix, Perl, Vim, GNU,
Linux, etc, and those who know COBOL.  It gets very difficult for me at
parties, not knowing which group to socialise with :-)
                                                Sitaram Chamarty

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220601150303.23F3F1C11B5%40moolenaar.net.

Raspunde prin e-mail lui