summaryrefslogtreecommitdiff
path: root/usr.bin/vi/ex/ex.c
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>2001-01-17 00:57:34 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>2001-01-17 00:57:34 +0000
commitc7a7ab4fef7e21029386d42a5cabbbbb7a7522e2 (patch)
tree242f88aa000a0f70a98747b5f5db758a3b6d3e98 /usr.bin/vi/ex/ex.c
parent7ac392e11c2ef309e1d69c0e58c3998667e0569e (diff)
Don't dump core when a ``bad address'' error occurs and there is neither
a file nor a command underlying it. This fixes NetBSD PR 11543; the fix is from Aymeric Vincent <aymeric@netbsd.org>.
Diffstat (limited to 'usr.bin/vi/ex/ex.c')
-rw-r--r--usr.bin/vi/ex/ex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/vi/ex/ex.c b/usr.bin/vi/ex/ex.c
index f92d8f7c4f9..ca3227b09d4 100644
--- a/usr.bin/vi/ex/ex.c
+++ b/usr.bin/vi/ex/ex.c
@@ -2307,7 +2307,7 @@ ex_badaddr(sp, cp, ba, nret)
* underlying file, that's the real problem.
*/
if (sp->ep == NULL) {
- ex_emsg(sp, cp->name, EXM_NOFILEYET);
+ ex_emsg(sp, cp != NULL ? cp->name : NULL, EXM_NOFILEYET);
return;
}