diff options
author | lum <lum@cvs.openbsd.org> | 2012-01-26 04:14:12 +0000 |
---|---|---|
committer | lum <lum@cvs.openbsd.org> | 2012-01-26 04:14:12 +0000 |
commit | d06612e465227db0e42d01ab25217d5ec4f6541f (patch) | |
tree | 7783a8a3ec75bfc9916c812fcfe1a866043fb138 /usr.bin/mg | |
parent | 0ca8da635f0b2cb138f4ebc698045746f9699b0c (diff) |
Tidy window and buffer NULL checks.
Reveiwed by Sunil Nimmagadda.
Diffstat (limited to 'usr.bin/mg')
-rw-r--r-- | usr.bin/mg/main.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/mg/main.c b/usr.bin/mg/main.c index dd9a4c392a7..f80e1f9341d 100644 --- a/usr.bin/mg/main.c +++ b/usr.bin/mg/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.62 2011/11/28 04:41:39 lum Exp $ */ +/* $OpenBSD: main.c,v 1.63 2012/01/26 04:14:11 lum Exp $ */ /* This file is in the public domain. */ @@ -204,11 +204,13 @@ edinit(PF init_fcn) bheadp = NULL; bp = bfind("*init*", TRUE); /* Text buffer. */ + if (bp == NULL) + panic("edinit"); + wp = new_window(bp); if (wp == NULL) panic("Out of memory"); - if (bp == NULL || wp == NULL) - panic("edinit"); + curbp = bp; /* Current ones. */ wheadp = wp; curwp = wp; |