Skip to content

Unnecessary STRLEN() calls in insexpand.c - #16814

Closed
zeertzjq wants to merge 1 commit into
vim:masterfrom
zeertzjq:insexpand
Closed

zeertzjq wants to merge 1 commit into
vim:masterfrom
zeertzjq:insexpand

Conversation

@zeertzjq

@zeertzjq zeertzjq commented Mar 7, 2025

Copy link
Copy Markdown
Member

Problem: Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length.

Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length.
Comment thread src/insexpand.c

// skip non-consecutive prefixes
if (STRNCMP(prefix, leader, leader_len) != 0)
if (leader_len > 0 && STRNCMP(prefix, leader, leader_len) != 0)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may fix a Coverity warning for NULL dereference.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks

@chrisbra chrisbra closed this in 4422de6 Mar 7, 2025
@zeertzjq
zeertzjq deleted the insexpand branch March 7, 2025 21:34
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Mar 7, 2025
Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length (zeertzjq).

closes: vim/vim#16814

vim/vim@4422de6
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Mar 8, 2025
Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length (zeertzjq).

closes: vim/vim#16814

vim/vim@4422de6
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Mar 12, 2025
Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length (zeertzjq).

closes: vim/vim#16814

vim/vim@4422de6
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Mar 13, 2025
Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length (zeertzjq).

closes: vim/vim#16814

vim/vim@4422de6
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Mar 13, 2025
Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length (zeertzjq).

closes: vim/vim#16814

vim/vim@4422de6
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Mar 14, 2025
Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length (zeertzjq).

closes: vim/vim#16814

vim/vim@4422de6
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Mar 21, 2025
Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length (zeertzjq).

closes: vim/vim#16814

vim/vim@4422de6
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Mar 21, 2025
Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length (zeertzjq).

closes: vim/vim#16814

vim/vim@4422de6
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Mar 26, 2025
Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length (zeertzjq).

closes: vim/vim#16814

vim/vim@4422de6
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Mar 26, 2025
Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length (zeertzjq).

closes: vim/vim#16814

vim/vim@4422de6
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Mar 26, 2025
Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length (zeertzjq).

closes: vim/vim#16814

vim/vim@4422de6
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Mar 26, 2025
Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length (zeertzjq).

closes: vim/vim#16814

vim/vim@4422de6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants