소스 검색

segmentlib: malloc -> calloc

Markus Metz 6 년 전
부모
커밋
bdb44f10b3
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      lib/segment/open.c

+ 1 - 1
lib/segment/open.c

@@ -60,7 +60,7 @@ Segment_open(SEGMENT *SEG, char *fname, off_t nrows, off_t ncols,
 	SEG->ncols = ncols;
 	SEG->len = len;
 	SEG->nseg = nseg;
-	SEG->cache = G_malloc(sizeof(char) * SEG->nrows * SEG->ncols * SEG->len);
+	SEG->cache = G_calloc(sizeof(char) * SEG->nrows * SEG->ncols, SEG->len);
 	SEG->scb = NULL;
 	SEG->open = 1;