use calloc to get window structure to guarantee all zero start
authorKen Arnold <arnold@ucbvax.Berkeley.EDU>
Mon, 26 Oct 1981 16:06:20 +0000 (08:06 -0800)
committerKen Arnold <arnold@ucbvax.Berkeley.EDU>
Mon, 26 Oct 1981 16:06:20 +0000 (08:06 -0800)
SCCS-vsn: lib/libcurses/newwin.c 1.3

usr/src/lib/libcurses/newwin.c

index 9485bff..94af2bc 100644 (file)
@@ -107,7 +107,7 @@ int num_lines, num_cols, begy, begx; {
 # ifdef        DEBUG
        fprintf(outf, "MAKENEW(%d, %d, %d, %d)\n", nl, nc, by, bx);
 # endif
 # ifdef        DEBUG
        fprintf(outf, "MAKENEW(%d, %d, %d, %d)\n", nl, nc, by, bx);
 # endif
-       if ((win = (WINDOW *) malloc(sizeof (WINDOW))) == NULL)
+       if ((win = (WINDOW *) calloc(1, sizeof (WINDOW))) == NULL)
                return NULL;
 # ifdef DEBUG
        fprintf(outf, "MAKENEW: nl = %d\n", nl);
                return NULL;
 # ifdef DEBUG
        fprintf(outf, "MAKENEW: nl = %d\n", nl);