From 588bbbdde6117f74a3abc317e478fe144a1d0c31 Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@fe.uni-lj.si>
Date: Tue, 16 Feb 2016 14:34:47 +0000
Subject: [PATCH] Extracted data from the python

---
 src/snapshot.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/snapshot.c b/src/snapshot.c
index 6bbefdb..a39ff87 100644
--- a/src/snapshot.c
+++ b/src/snapshot.c
@@ -29,7 +29,7 @@
 	xml_trisurf_vtx_tristar(data,vesicle->vlist);
 #ifdef COMPRESSION
 	char *compressed;
-	ts_uint nbytes=ts_compress_string64(data->string, data->beg, &compressed);
+	ts_uint nbytes=ts_compress_string64(data->string, data->beg-1, &compressed); //suppress null character at the end with by substracting 1
 	fwrite(compressed, sizeof(unsigned char), nbytes, fh);
 	free (compressed);
 #else
@@ -59,11 +59,11 @@
 
 ts_bool xml_trisurf_tria(ts_string *data, ts_triangle_list *tlist){
 	ts_uint i;
-	ts_sprintf(data,"<tria>\n");
+	ts_sprintf(data,"<tria>");
 	for(i=0; i<tlist->n;i++){
-		ts_sprintf(data,"%u %u %u\n",tlist->tria[i]->vertex[0]->idx, tlist->tria[i]->vertex[1]->idx, tlist->tria[i]->vertex[2]->idx);
+		ts_sprintf(data,"%u %u %u",tlist->tria[i]->vertex[0]->idx, tlist->tria[i]->vertex[1]->idx, tlist->tria[i]->vertex[2]->idx);
 	}
-	ts_sprintf(data,"</tria>\n");
+	ts_sprintf(data,"</tria>");
 	return TS_SUCCESS;
 }
 
@@ -71,7 +71,7 @@
 	ts_uint i;
 	ts_sprintf(data,"<trianeigh>\n");
 	for(i=0; i<tlist->n;i++){
-		ts_sprintf(data,"%u %u %u\n",tlist->tria[i]->neigh[0]->idx, tlist->tria[i]->neigh[1]->idx, tlist->tria[i]->neigh[2]->idx);
+		ts_sprintf(data,"%u %u %u",tlist->tria[i]->neigh[0]->idx, tlist->tria[i]->neigh[1]->idx, tlist->tria[i]->neigh[2]->idx);
 	}
 	ts_sprintf(data,"</trianeigh>\n");
 	return TS_SUCCESS;
@@ -84,7 +84,7 @@
 		for(j=0;j<vlist->vtx[i]->neigh_no;j++){
 			ts_sprintf(data,"%u ",vlist->vtx[i]->neigh[j]->idx);
 		}
-		ts_sprintf(data, "</vtxn>\n");
+		ts_sprintf(data, "</vtxn>");
 	}
 	return TS_SUCCESS;
 }
@@ -96,7 +96,7 @@
 		for(j=0;j<vlist->vtx[i]->tristar_no;j++){
 			ts_sprintf(data,"%u ",vlist->vtx[i]->tristar[j]->idx);
 		}
-		ts_sprintf(data, "</tristar>\n");
+		ts_sprintf(data, "</tristar>");
 	}
 	return TS_SUCCESS;
 }

--
Gitblit v1.9.3