From c37695a5d5f2e8914fff86f3581bed70b4c85d3c Mon Sep 17 00:00:00 2001 From: James <89495599+IAKOBVS@users.noreply.github.com> Date: Tue, 11 Jun 2024 22:40:24 +0700 Subject: refactor: use S_LEN(s) instead of s, n (#29219) --- src/nvim/regexp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/regexp.c') diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 2ff4dbee70..ad3cce9120 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -11517,7 +11517,7 @@ static void nfa_print_state2(FILE *debugf, nfa_state_T *state, garray_T *indent) uint8_t save[2]; strncpy(save, &p[last], 2); // NOLINT(runtime/printf) - memcpy(&p[last], "+-", 2); + memcpy(&p[last], S_LEN("+-")); fprintf(debugf, " %s", p); strncpy(&p[last], save, 2); // NOLINT(runtime/printf) } else { @@ -15932,7 +15932,7 @@ regprog_T *vim_regcomp(const char *expr_arg, int re_flags) regexp_engine = (int)p_re; // Check for prefix "\%#=", that sets the regexp engine - if (strncmp(expr, "\\%#=", 4) == 0) { + if (strncmp(expr, S_LEN("\\%#=")) == 0) { int newengine = expr[4] - '0'; if (newengine == AUTOMATIC_ENGINE -- cgit