diff options
author | Dundar Goc <gocdundar@gmail.com> | 2022-05-07 12:53:37 +0200 |
---|---|---|
committer | Dundar Goc <gocdundar@gmail.com> | 2022-06-10 16:16:41 +0200 |
commit | a732c253b71f89702285d5ec6fd7803045f6add9 (patch) | |
tree | cd6b0dbad292dcbfaae637ffad385298594a2ff2 /src/nvim/debugger.c | |
parent | e15d31b530c443daea04d7a772b24da737397c53 (diff) | |
download | rneovim-a732c253b71f89702285d5ec6fd7803045f6add9.tar.gz rneovim-a732c253b71f89702285d5ec6fd7803045f6add9.tar.bz2 rneovim-a732c253b71f89702285d5ec6fd7803045f6add9.zip |
refactor: change type of linenr_T from long to int32_t
The size of long varies depending on architecture, in contrast to the
MAXLNUM constant which sets the maximum allowable number of lines to
2^32-1. This discrepancy may lead to hard to detect bugs, for example
https://github.com/neovim/neovim/issues/18454. Setting linenr_T to a
fix maximum size of 2^32-1 will prevent this type of errors in the
future.
Also change the variables `amount` and `amount_after` to be linenr_T
since they're referring to "the line number difference" between two
texts.
Diffstat (limited to 'src/nvim/debugger.c')
-rw-r--r-- | src/nvim/debugger.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/debugger.c b/src/nvim/debugger.c index 30d6ea2505..29dcddfc0d 100644 --- a/src/nvim/debugger.c +++ b/src/nvim/debugger.c @@ -506,7 +506,7 @@ static int dbg_parsearg(char_u *arg, garray_T *gap) if (here) { bp->dbg_lnum = curwin->w_cursor.lnum; } else if (gap != &prof_ga && ascii_isdigit(*p)) { - bp->dbg_lnum = getdigits_long((char_u **)&p, true, 0); + bp->dbg_lnum = getdigits_int32(&p, true, 0); p = skipwhite(p); } else { bp->dbg_lnum = 0; |