diff options
author | Kjell Wooding <kjell@cvs.openbsd.org> | 2005-10-13 05:59:20 +0000 |
---|---|---|
committer | Kjell Wooding <kjell@cvs.openbsd.org> | 2005-10-13 05:59:20 +0000 |
commit | 2e292086e6e3f851add4c223c4c31670d56110d4 (patch) | |
tree | 03cc43cef6593b0740096bd4476f1425f36766d7 /usr.bin | |
parent | b09ffc412d1e814780768090c2e33095042d015d (diff) |
check if current line is null. fixes a core in dired.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mg/fileio.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/mg/fileio.c b/usr.bin/mg/fileio.c index 55275b75ecb..b0a2a6f04ae 100644 --- a/usr.bin/mg/fileio.c +++ b/usr.bin/mg/fileio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fileio.c,v 1.51 2005/10/13 05:47:45 kjell Exp $ */ +/* $OpenBSD: fileio.c,v 1.52 2005/10/13 05:59:19 kjell Exp $ */ /* This file is in the public domain. */ @@ -454,7 +454,8 @@ d_makename(LINE *lp, char *fn, int len) char *p, *ep; strlcpy(fn, curbp->b_fname, len); - p = lp->l_text; + if ((p = lp->l_text) == NULL) + return (ABORT); ep = lp->l_text + llength(lp); p++; /* skip action letter, if any */ for (i = 0; i < NAME_FIELD; i++) { |