aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/regexp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r--src/nvim/regexp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index 5600d6a2f8..e00dbdfc78 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -18,6 +18,7 @@
#include "nvim/ascii_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
+#include "nvim/errors.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
#include "nvim/eval/userfunc.h"
@@ -11450,7 +11451,7 @@ static void nfa_set_code(int c)
}
if (addnl == true) {
- STRCAT(code, " + NEWLINE ");
+ strcat(code, " + NEWLINE ");
}
}
@@ -11494,7 +11495,7 @@ static void nfa_print_state(FILE *debugf, nfa_state_T *state)
garray_T indent;
ga_init(&indent, 1, 64);
- ga_append(&indent, '\0');
+ ga_append(&indent, NUL);
nfa_print_state2(debugf, state, &indent);
ga_clear(&indent);
}
@@ -11516,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 {
@@ -14800,7 +14801,7 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *subm
}
case NFA_ANY:
- // Any char except '\0', (end of input) does not match.
+ // Any char except NUL, (end of input) does not match.
if (curc > 0) {
add_state = t->state->out;
add_off = clen;
@@ -15931,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