From f6bc99c334f6481e40f547d0e91f771b9564aa38 Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@fe.uni-lj.si>
Date: Tue, 05 Jul 2016 10:09:08 +0000
Subject: [PATCH] Merge branch 'clustercount' into nirgov

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

diff --git a/src/cluster.c b/src/cluster.c
index 5d05058..9a43183 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -42,12 +42,13 @@
 			do{
 				n--;
 			} while(cstlist->cluster[n]==NULL && n>i);
+			if(i<=n) break;
 			cstlist->cluster[i]=cstlist->cluster[n];
 			cstlist->cluster[n]=NULL;
 		}
 	}
 	cstlist->cluster=(ts_cluster **)realloc(cstlist->cluster,n*sizeof(ts_cluster *));
-
+	cstlist->n=n;
 	return TS_SUCCESS;
 }
 

--
Gitblit v1.9.3