|
@@ -44,13 +44,13 @@ cmArRC_t cmArrayAlloc0( cmCtx_t* ctx, cmArrayH_t* hp, unsigned eleByteCnt, u
|
44
|
44
|
cmAr_t* p = cmMemAllocZ(cmAr_t,1);
|
45
|
45
|
cmErrSetup(&p->err,&ctx->rpt,"Array");
|
46
|
46
|
|
47
|
|
- p->alloc_cnt = initCnt * eleByteCnt;
|
|
47
|
+ p->alloc_cnt = initCnt;
|
48
|
48
|
p->expand_cnt = expandCnt;
|
49
|
49
|
p->cur_cnt = 0;
|
50
|
50
|
p->ele_byte_cnt = eleByteCnt;
|
51
|
51
|
|
52
|
52
|
if( p->alloc_cnt > 0 )
|
53
|
|
- p->base = cmMemAllocZ(char,p->alloc_cnt);
|
|
53
|
+ p->base = cmMemAllocZ(char,p->alloc_cnt*eleByteCnt);
|
54
|
54
|
|
55
|
55
|
hp->h = p;
|
56
|
56
|
|