From 692fb5ed82bb9b6ee4be4d5463323585d142c0ea Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Thu, 17 Oct 2019 17:39:32 +0000
Subject: [PATCH] Solved some, still missing some

---
 src/io.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/io.c b/src/io.c
index a2b50d9..abd4fce 100644
--- a/src/io.c
+++ b/src/io.c
@@ -255,7 +255,7 @@
 	fprintf(fh, " <UnstructuredGrid>\n");
     fprintf(fh, "<Piece NumberOfPoints=\"%u\" NumberOfCells=\"%u\">\n",vlist->n+monono*polyno+fonono*filno, blist->n+monono*polyno+filno*(fonono-1)+vesicle->tlist->n);
     fprintf(fh,"<PointData Scalars=\"vertices_idx\">\n<DataArray type=\"Int64\" Name=\"vertices_idx\" format=\"binary\">");
-	int *int_vector=(int *)malloc(vlist->n+monono*polyno+fonono*filno*sizeof(ts_uint));
+	int *int_vector=(int *)malloc((vlist->n+monono*polyno+fonono*filno)*sizeof(ts_uint));
 	int offset=0;
    	for(i=0;i<vlist->n;i++){
 	//	fprintf(fh,"%u ",vtx[i]->idx);
@@ -285,7 +285,7 @@
 			offset=offset+j;
 		}
 	}
-	char *printout=ts_compress_intlist(int_vector,vlist->n+monono*polyno+fonono*filno*sizeof(ts_uint));
+	char *printout=ts_compress_intlist(int_vector,(vlist->n+monono*polyno+fonono*filno)*sizeof(ts_uint));
 	fprintf(fh,"%s",printout);
 	free(printout);
 

--
Gitblit v1.9.3