diff options
-rw-r--r-- | usr.bin/vi/common/key.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/vi/common/key.c b/usr.bin/vi/common/key.c index e3a85e2e7f7..8b14269c598 100644 --- a/usr.bin/vi/common/key.c +++ b/usr.bin/vi/common/key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: key.c,v 1.19 2017/04/18 01:45:35 deraadt Exp $ */ +/* $OpenBSD: key.c,v 1.20 2022/04/21 17:50:29 millert Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -650,7 +650,10 @@ not_digit: argp->e_c = CH_NOT_DIGIT; } /* Find out if the initial segments are identical. */ - init_nomap = !e_memcmp(qp->output, &gp->i_event[gp->i_next], qp->ilen); + if (qp->output != NULL) { + init_nomap = + !e_memcmp(qp->output, &gp->i_event[gp->i_next], qp->ilen); + } /* Delete the mapped characters from the queue. */ QREM(qp->ilen); |