Problem: Coverity reports dead code.
Solution: Remove the dead code. Also fix some comments in other files.
https://github.com/vim/vim/pull/14189
(5 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@zeertzjq pushed 1 commit.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.
@zeertzjq pushed 1 commit.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.
@chrisbra commented on this pull request.
In src/ops.c:
> col = pos->col; - if (*ptr == NUL || col + !!save_coladd >= (int)STRLEN(ptr))
why is the *ptr == NUL
condition removed?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@zeertzjq commented on this pull request.
It's not needed because col >= 0
, and ml_get_len()
returns 0 if *ptr == NUL
.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@chrisbra commented on this pull request.
In src/memline.c:
> @@ -2686,7 +2686,7 @@ ml_get_len(linenr_T lnum) colnr_T ml_get_pos_len(pos_T *pos) { - return ml_get_buf_len(curbuf, curwin->w_cursor.lnum) - pos->col; + return ml_get_buf_len(curbuf, pos->lnum) - pos->col;
oh, I should have caught this when reviewing yesterday :/
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@chrisbra commented on this pull request.
In src/ops.c:
> col = pos->col; - if (*ptr == NUL || col + !!save_coladd >= (int)STRLEN(ptr))
ah, so when *ptr == NUL
this means that the second condition will be also true: col + !!save_coladd >= linelen
I see. thanks
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
thanks!
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.