diff options
author | Thiago Farina <tfransosi@gmail.com> | 2010-12-16 21:37:50 -0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-12-16 15:46:43 -0800 |
commit | 823786d263fc88ef9343d56970044be17b6dd755 (patch) | |
tree | 676f5273783d7eed93cd96350c5d4cdaed81e669 | |
parent | 6e4aec520ef4f16960fb70d54b9e9a3955d12b03 (diff) | |
download | uemacs-823786d263fc88ef9343d56970044be17b6dd755.tar.gz |
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>
-rw-r--r-- | display.c | 24 |
1 files changed, 5 insertions, 19 deletions
@@ -18,6 +18,7 @@ #include "efunc.h" #include "line.h" #include "version.h" +#include "wrapper.h" struct video { int v_flag; /* Flags */ @@ -85,24 +86,13 @@ void vtinit(void) TTopen(); /* open the screen */ TTkopen(); /* open the keyboard */ TTrev(FALSE); - vscreen = (struct video **) malloc(term.t_mrow * sizeof(struct video *)); - - if (vscreen == NULL) - exit(1); + vscreen = xmalloc(term.t_mrow * sizeof(struct video *)); #if MEMMAP == 0 || SCROLLCODE - pscreen = (struct video **) malloc(term.t_mrow * sizeof(struct video *)); - - if (pscreen == NULL) - exit(1); + pscreen = xmalloc(term.t_mrow * sizeof(struct video *)); #endif - for (i = 0; i < term.t_mrow; ++i) { - vp = (struct video *)malloc(sizeof(struct video) + term.t_mcol); - - if (vp == NULL) - exit(1); - + vp = xmalloc(sizeof(struct video) + term.t_mcol); vp->v_flag = 0; #if COLOR vp->v_rfcolor = 7; @@ -110,11 +100,7 @@ void vtinit(void) #endif vscreen[i] = vp; #if MEMMAP == 0 || SCROLLCODE - vp = (struct video *)malloc(sizeof(struct video) + term.t_mcol); - - if (vp == NULL) - exit(1); - + vp = xmalloc(sizeof(struct video) + term.t_mcol); vp->v_flag = 0; pscreen[i] = vp; #endif |