diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/regexp_nfa.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index d34e653058..d1369e4532 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -1420,12 +1420,12 @@ static int nfa_regatom(void) default: nr = -1; break; } - if (nr < 0) - EMSG2_RET_FAIL( - _("E678: Invalid character after %s%%[dxouU]"), - reg_magic == MAGIC_ALL); - /* A NUL is stored in the text as NL */ - /* TODO: what if a composing character follows? */ + if (nr < 0 || nr > INT_MAX) { + EMSG2_RET_FAIL(_("E678: Invalid character after %s%%[dxouU]"), + reg_magic == MAGIC_ALL); + } + // A NUL is stored in the text as NL + // TODO(vim): what if a composing character follows? EMIT(nr == 0 ? 0x0a : nr); } break; |