Index: z37.c =================================================================== RCS file: /home/uwe/repository/lout/z37.c,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 z37.c --- z37.c 1998/04/08 18:26:36 1.1.1.2 +++ z37.c 1998/10/14 00:59:16 @@ -89,7 +89,7 @@ New(font_root, ACAT); New(font_used, ACAT); font_seqnum = 0; - finfo = (FONT_INFO *) malloc(INIT_FINFO_SIZE * sizeof(FONT_INFO)); + finfo = (FONT_INFO *) calloc(INIT_FINFO_SIZE, sizeof(FONT_INFO)); finfo_size = INIT_FINFO_SIZE; ifdebug(DMA, D, DebugRegisterUsage(MEM_FONTS, 1, INIT_FINFO_SIZE * sizeof(FONT_INFO))); @@ -325,13 +325,13 @@ /* initialise font metrics table for the new font */ ifdebug(DMA, D, DebugRegisterUsage(MEM_FONTS, 1, MAX_CHARS * sizeof(struct metrics))); - fnt = (struct metrics *) malloc(MAX_CHARS * sizeof(struct metrics)); + fnt = (struct metrics *) calloc(MAX_CHARS, sizeof(struct metrics)); if( fnt == (struct metrics *) NULL ) Error(37, 10, "run out of memory while reading font file %s", FATAL, &fpos(err), FileName(fnum)); ifdebug(DMA, D, DebugRegisterUsage(MEM_FONTS, 0, 2*MAX_CHARS*sizeof(FULL_CHAR))); - lig = (FULL_CHAR *) malloc(2*MAX_CHARS*sizeof(FULL_CHAR)); + lig = (FULL_CHAR *) calloc(MAX_CHARS * 2, sizeof(FULL_CHAR)); /* initialise ligature table for the new font */ if( lig == (FULL_CHAR *) NULL ) @@ -343,7 +343,7 @@ /* initialise kerning table for the new font */ ifdebug(DMA, D, DebugRegisterUsage(MEM_FONTS, 0, MAX_CHARS * sizeof(unsigned short))); - kt = (unsigned short *) malloc(MAX_CHARS * sizeof(unsigned short)); + kt = (unsigned short *) calloc(MAX_CHARS, sizeof(unsigned short)); if( kt == (unsigned short *) NULL ) Error(37, 12, "run out of memory while reading font file %s", FATAL, &fpos(err), FileName(fnum)); @@ -544,13 +544,13 @@ kc_top = 1; ks_top = 1; ifdebug(DMA, D, DebugRegisterUsage(MEM_FONTS, 0, 2*num_pairs * sizeof(FULL_CHAR))); - kc = (FULL_CHAR *) malloc(2 * num_pairs * sizeof(FULL_CHAR)); + kc = (FULL_CHAR *) calloc(2 * num_pairs, sizeof(FULL_CHAR)); ifdebug(DMA, D, DebugRegisterUsage(MEM_FONTS, 0, 2 * num_pairs * sizeof(unsigned char))); - kv = (unsigned char *) malloc(2 * num_pairs * sizeof(unsigned char)); + kv = (unsigned char *) calloc(2 * num_pairs, sizeof(unsigned char)); ifdebug(DMA, D, DebugRegisterUsage(MEM_FONTS, 0, num_pairs * sizeof(SHORT_LENGTH))); - ks = (SHORT_LENGTH *) malloc(num_pairs * sizeof(SHORT_LENGTH)); + ks = (SHORT_LENGTH *) calloc(num_pairs, sizeof(SHORT_LENGTH)); last_ch1 = '\0'; while( StringFGets(buff, MAX_BUFF, fp) == (char *) buff && !StringBeginsWith(buff, AsciiToFull("EndKernPairs")) ) @@ -947,7 +947,7 @@ ifdebug(DMA, D, DebugRegisterUsage(MEM_FONTS, 1, MAX_CHARS * sizeof(struct metrics))); finfo[font_count].size_table = - (struct metrics *) malloc(MAX_CHARS * sizeof(struct metrics)); + (struct metrics *) calloc(MAX_CHARS, sizeof(struct metrics)); if( finfo[font_count].size_table == (struct metrics *) NULL ) Error(37, 46, "run out of memory when changing font or font size", FATAL, &fpos(x)); @@ -973,7 +973,7 @@ { klen = oldks[0]; ifdebug(DMA, D, DebugRegisterUsage(MEM_FONTS, 0, klen * sizeof(SHORT_LENGTH))); finfo[font_count].kern_sizes = newks = - (SHORT_LENGTH *) malloc(klen * sizeof(SHORT_LENGTH)); + (SHORT_LENGTH *) calloc(klen, sizeof(SHORT_LENGTH)); if( newks == (SHORT_LENGTH *) NULL ) Error(37, 47, "run out of memory when changing font or font size", FATAL, &fpos(x));