malloc/memset -> calloc

This commit is contained in:
William McBrine
2006-07-29 06:18:24 +00:00
parent 5544d05257
commit a40cc473ff

View File

@@ -20,7 +20,7 @@
#include <stdlib.h>
#include <string.h>
RCSID("$Id: pdcwin.c,v 1.47 2006/07/29 04:25:51 wmcbrine Exp $");
RCSID("$Id: pdcwin.c,v 1.48 2006/07/29 06:18:24 wmcbrine Exp $");
static int PDC_newline(WINDOW *, int);
@@ -151,13 +151,9 @@ WINDOW *PDC_makenew(int num_lines, int num_columns, int begy, int begx)
/* allocate the window structure itself */
if ((win = malloc(sizeof(WINDOW))) == (WINDOW *)NULL)
if ((win = calloc(1, sizeof(WINDOW))) == (WINDOW *)NULL)
return win;
/* set all fields to zero */
memset(win, 0, sizeof(WINDOW));
/* allocate the line pointer array */
if ((win->_y = calloc(num_lines, sizeof(chtype *))) == NULL)