Mercurial > hg > old > magoroku_racing
changeset 139:dbf8858aceed
malloc error in col.cc
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 23 Jul 2011 00:40:53 +0900 |
parents | 993d5f7e5f30 |
children | 6674b7498075 |
files | col.cc getStrFromFile.cc |
diffstat | 2 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/col.cc Fri Jul 22 23:51:14 2011 +0900 +++ b/col.cc Sat Jul 23 00:40:53 2011 +0900 @@ -128,9 +128,9 @@ FVECTOR p1, p2; ColFacePtr colface; - malloc_align16(&hd->free_addr, &colface, sizeof(ColFace)*face->pp_num); + hd->facenum = face->size/3; + malloc_align16(&hd->free_addr, &colface, sizeof(ColFace)*hd->facenum); - hd->facenum = face->size/3; for (i=0; i < hd->facenum; i++) {
--- a/getStrFromFile.cc Fri Jul 22 23:51:14 2011 +0900 +++ b/getStrFromFile.cc Sat Jul 23 00:40:53 2011 +0900 @@ -47,7 +47,7 @@ // 余分なsearchEndStr以降の文字列を切り捨てるため空白文字(改行文字だっけ?'\0'ってなんだっけ) //p1[p1Len - p2Len] = '\0'; - p2 = '\0'; + *p2 = '\0'; int searchStartStrLen = strlen(searchStartStr); // +searchStartStrLenで最初の余分な文字列をカウントしないようにする