summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mg/line.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/mg/line.c b/usr.bin/mg/line.c
index 4e4f5248738..527893b119f 100644
--- a/usr.bin/mg/line.c
+++ b/usr.bin/mg/line.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: line.c,v 1.61 2018/08/29 07:50:16 reyk Exp $ */
+/* $OpenBSD: line.c,v 1.62 2020/07/22 13:22:53 tb Exp $ */
/* This file is in the public domain. */
@@ -556,6 +556,8 @@ lreplace(RSIZE plen, char *st)
goto done;
lp = curwp->w_dotp;
+ if (ltext(lp) == NULL)
+ goto done;
doto = curwp->w_doto;
n = plen;