aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-11-28 18:11:41 +0100
committerGitHub <noreply@github.com>2022-11-28 18:11:41 +0100
commitccd17543f32a892814c3d32eb5e979722b843da9 (patch)
treef4768eb7d7be52402ccd55e3e4e04aecceab3e42 /src/nvim/buffer.c
parentb2bb3973d9c7f25acfead2718d74fcf5b1e4551e (diff)
parent3b96ccf7d35be90e49029dec76344d3d92ad91dc (diff)
downloadrneovim-ccd17543f32a892814c3d32eb5e979722b843da9.tar.gz
rneovim-ccd17543f32a892814c3d32eb5e979722b843da9.tar.bz2
rneovim-ccd17543f32a892814c3d32eb5e979722b843da9.zip
Merge pull request #21200 from dundargoc/refactor/char_u/15
refactor: replace char_u with char 15 - remove STRNLEN and STRNCPY
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 485a6669ef..67c3307e50 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -3735,8 +3735,8 @@ static int chk_modeline(linenr_T lnum, int flags)
prev = -1;
for (s = ml_get(lnum); *s != NUL; s++) {
if (prev == -1 || ascii_isspace(prev)) {
- if ((prev != -1 && STRNCMP(s, "ex:", (size_t)3) == 0)
- || STRNCMP(s, "vi:", (size_t)3) == 0) {
+ if ((prev != -1 && strncmp(s, "ex:", (size_t)3) == 0)
+ || strncmp(s, "vi:", (size_t)3) == 0) {
break;
}
// Accept both "vim" and "Vim".
@@ -3752,7 +3752,7 @@ static int chk_modeline(linenr_T lnum, int flags)
if (*e == ':'
&& (s[0] != 'V'
- || STRNCMP(skipwhite((char *)e + 1), "set", 3) == 0)
+ || strncmp(skipwhite(e + 1), "set", 3) == 0)
&& (s[3] == ':'
|| (VIM_VERSION_100 >= vers && isdigit(s[3]))
|| (VIM_VERSION_100 < vers && s[3] == '<')
@@ -3801,8 +3801,8 @@ static int chk_modeline(linenr_T lnum, int flags)
// "vi:set opt opt opt: foo" -- foo not interpreted
// "vi:opt opt opt: foo" -- foo interpreted
// Accept "se" for compatibility with Elvis.
- if (STRNCMP(s, "set ", (size_t)4) == 0
- || STRNCMP(s, "se ", (size_t)3) == 0) {
+ if (strncmp(s, "set ", (size_t)4) == 0
+ || strncmp(s, "se ", (size_t)3) == 0) {
if (*e != ':') { // no terminating ':'?
break;
}