now checking the number of descriptors changed in  select
diff --git a/nlsr-sync-0.0/nlsr.c b/nlsr-sync-0.0/nlsr.c
index d25fb9d..4c4bc3b 100755
--- a/nlsr-sync-0.0/nlsr.c
+++ b/nlsr-sync-0.0/nlsr.c
@@ -934,7 +934,7 @@
 	testfds=nlsr->readfds;
 	result = select(FD_SETSIZE, &testfds, NULL,NULL, &timeout);
 	
-	for(fd = 0; fd < FD_SETSIZE; fd++) 
+	for(fd = 0; fd < FD_SETSIZE && result > 0; fd++) 
 	{
 		if(FD_ISSET(fd,&testfds)) 
 		{