summaryrefslogtreecommitdiff
path: root/usr.bin/mg/main.c
diff options
context:
space:
mode:
authorVincent Labrecque <vincent@cvs.openbsd.org>2003-10-27 11:21:13 +0000
committerVincent Labrecque <vincent@cvs.openbsd.org>2003-10-27 11:21:13 +0000
commit999b065f9ebbc179d82c564a22f1f0fd4e8f1804 (patch)
treeb91c56265b8de6bc334243502eaee36fcecf0161 /usr.bin/mg/main.c
parentcb48f9d51463dff7978fe45bea2b306a53c09628 (diff)
fix crash on startup by using the good allocation routine in edinit()
spotted and ok by henning
Diffstat (limited to 'usr.bin/mg/main.c')
-rw-r--r--usr.bin/mg/main.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/usr.bin/mg/main.c b/usr.bin/mg/main.c
index 9cc3ce3853d..568b20ed60a 100644
--- a/usr.bin/mg/main.c
+++ b/usr.bin/mg/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.25 2003/06/26 23:04:10 vincent Exp $ */
+/* $OpenBSD: main.c,v 1.26 2003/10/27 11:21:12 vincent Exp $ */
/*
* Mainline.
@@ -157,7 +157,7 @@ edinit(PF init_fcn)
bheadp = NULL;
bp = bfind("*scratch*", TRUE); /* Text buffer. */
- wp = (MGWIN *)malloc(sizeof(MGWIN)); /* Initial window. */
+ wp = new_window(bp);
if (wp == NULL)
panic("Out of memory");
if (bp == NULL || wp == NULL)
@@ -166,15 +166,8 @@ edinit(PF init_fcn)
wheadp = wp;
curwp = wp;
wp->w_wndp = NULL; /* Initialize window. */
- wp->w_bufp = bp;
- bp->b_nwnd = 1; /* Displayed. */
wp->w_linep = wp->w_dotp = bp->b_linep;
- wp->w_doto = 0;
- wp->w_markp = NULL;
- wp->w_marko = 0;
- wp->w_toprow = 0;
wp->w_ntrows = nrow - 2; /* 2 = mode, echo. */
- wp->w_force = 0;
wp->w_flag = WFMODE | WFHARD; /* Full. */
if (init_fcn)