mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(diff): add NULL check
This commit is contained in:
parent
6969d3d749
commit
98f2df931a
@ -161,6 +161,9 @@ void fastforward_buf_to_lnum(const char **s, long lnum)
|
|||||||
{
|
{
|
||||||
for (long i = 0; i < lnum - 1; i++) {
|
for (long i = 0; i < lnum - 1; i++) {
|
||||||
*s = strchr(*s, '\n');
|
*s = strchr(*s, '\n');
|
||||||
|
if (!*s) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
(*s)++;
|
(*s)++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user