use calloc instead of malloc, to make sure block is initialized to 0

This commit is contained in:
ceriel 1989-03-01 10:00:37 +00:00
parent 5c7325e0de
commit a22bbe847f
2 changed files with 2 additions and 1 deletions

View file

@ -116,6 +116,7 @@ extern FILE *fftemp();
extern long atol(); extern long atol();
extern char *mktemp(); extern char *mktemp();
extern char *malloc(); extern char *malloc();
extern char *calloc();
extern char *getenv(); extern char *getenv();
extern char *strncpy(); extern char *strncpy();

View file

@ -198,7 +198,7 @@ small(fitsmall, gain)
return(0); return(0);
} }
if (pbittab[bitindex] == 0 && pass == PASS_1) { if (pbittab[bitindex] == 0 && pass == PASS_1) {
if ((pbittab[bitindex] = malloc(MEMINCR)) == 0) { if ((pbittab[bitindex] = calloc(MEMINCR, 1)) == 0) {
static int w2_given; static int w2_given;
if (!w2_given) { if (!w2_given) {