1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-12-24 01:56:26 -05:00

uemacs: display.c: Use the newly introduced xmalloc function.

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Thiago Farina 2010-12-16 21:37:50 -02:00 committed by Linus Torvalds
parent 6e4aec520e
commit 823786d263

View File

@ -18,6 +18,7 @@
#include "efunc.h" #include "efunc.h"
#include "line.h" #include "line.h"
#include "version.h" #include "version.h"
#include "wrapper.h"
struct video { struct video {
int v_flag; /* Flags */ int v_flag; /* Flags */
@ -85,24 +86,13 @@ void vtinit(void)
TTopen(); /* open the screen */ TTopen(); /* open the screen */
TTkopen(); /* open the keyboard */ TTkopen(); /* open the keyboard */
TTrev(FALSE); TTrev(FALSE);
vscreen = (struct video **) malloc(term.t_mrow * sizeof(struct video *)); vscreen = xmalloc(term.t_mrow * sizeof(struct video *));
if (vscreen == NULL)
exit(1);
#if MEMMAP == 0 || SCROLLCODE #if MEMMAP == 0 || SCROLLCODE
pscreen = (struct video **) malloc(term.t_mrow * sizeof(struct video *)); pscreen = xmalloc(term.t_mrow * sizeof(struct video *));
if (pscreen == NULL)
exit(1);
#endif #endif
for (i = 0; i < term.t_mrow; ++i) { for (i = 0; i < term.t_mrow; ++i) {
vp = (struct video *)malloc(sizeof(struct video) + term.t_mcol); vp = xmalloc(sizeof(struct video) + term.t_mcol);
if (vp == NULL)
exit(1);
vp->v_flag = 0; vp->v_flag = 0;
#if COLOR #if COLOR
vp->v_rfcolor = 7; vp->v_rfcolor = 7;
@ -110,11 +100,7 @@ void vtinit(void)
#endif #endif
vscreen[i] = vp; vscreen[i] = vp;
#if MEMMAP == 0 || SCROLLCODE #if MEMMAP == 0 || SCROLLCODE
vp = (struct video *)malloc(sizeof(struct video) + term.t_mcol); vp = xmalloc(sizeof(struct video) + term.t_mcol);
if (vp == NULL)
exit(1);
vp->v_flag = 0; vp->v_flag = 0;
pscreen[i] = vp; pscreen[i] = vp;
#endif #endif