Index: /trunk/BNC/RTCM3/rtcm3torinex.c
===================================================================
--- /trunk/BNC/RTCM3/rtcm3torinex.c	(revision 2352)
+++ /trunk/BNC/RTCM3/rtcm3torinex.c	(revision 2353)
@@ -1,5 +1,5 @@
 /*
   Converter for RTCM3 data to RINEX.
-  $Id: rtcm3torinex.c,v 1.30 2010/01/16 10:21:09 mervart Exp $
+  $Id: rtcm3torinex.c,v 1.39 2010/03/05 11:11:06 stoecker Exp $
   Copyright (C) 2005-2008 by Dirk Stöcker <stoecker@alberding.eu>
 
@@ -49,5 +49,5 @@
 
 #ifndef isinf
-#  define isinf(x) 0
+#define isinf(x) 0
 #endif
 
@@ -55,5 +55,5 @@
 
 /* CVS revision and version */
-static char revisionstr[] = "$Revision: 1.30 $";
+static char revisionstr[] = "$Revision: 1.39 $";
 
 #ifndef COMPILEDATE
@@ -251,5 +251,5 @@
 }
 
-// Convert Moscow time into UTC (fixnumleap == 1) or GPS (fixnumleap == 0)
+/* Convert Moscow time into UTC (fixnumleap == 1) or GPS (fixnumleap == 0) */
 void updatetime(int *week, int *secOfWeek, int mSecOfWeek, int fixnumleap)
 {
@@ -490,5 +490,5 @@
         SKIPBITS(4) /* smind, smint */
 
-        while(numsats--)
+        while(numsats-- && gnss->numsats < GNSS_MAXSATS)
         {
           int sv, code, l1range, c,l,s,ce,le,se,amb=0;
@@ -640,5 +640,5 @@
         GETBITS(i,27) /* tk */
 
-        updatetime(&handle->GPSWeek, &handle->GPSTOW, i, 0); // Moscow -> GPS
+        updatetime(&handle->GPSWeek, &handle->GPSTOW, i, 0); /* Moscow -> GPS */
         i = handle->GPSTOW*1000;
         if(gnss->week && (gnss->timeofweek != i || gnss->week
@@ -658,5 +658,5 @@
         SKIPBITS(4) /* smind, smint */
 
-        while(numsats--)
+        while(numsats-- && gnss->numsats < GNSS_MAXSATS)
         {
           int sv, code, l1range, c,l,s,ce,le,se,amb=0;
@@ -1397,5 +1397,5 @@
             struct converttimeinfo cti;
 
-            updatetime(&w, &tow, e->tb*1000, 1);  // Moscow - > UTC
+            updatetime(&w, &tow, e->tb*1000, 1);  /* Moscow - > UTC */
             converttime(&cti, w, tow);
 
@@ -1684,5 +1684,5 @@
 
 #ifndef NO_RTCM3_MAIN
-static char datestr[]     = "$Date: 2010/01/16 10:21:09 $";
+static char datestr[]     = "$Date: 2010/03/05 11:11:06 $";
 
 /* The string, which is send as agent in HTTP request */
Index: /trunk/BNC/RTCM3/rtcm3torinex.h
===================================================================
--- /trunk/BNC/RTCM3/rtcm3torinex.h	(revision 2352)
+++ /trunk/BNC/RTCM3/rtcm3torinex.h	(revision 2353)
@@ -4,5 +4,5 @@
 /*
   Converter for RTCM3 data to RINEX.
-  $Id: rtcm3torinex.h,v 1.18 2009/11/04 16:19:40 zdenek Exp $
+  $Id: rtcm3torinex.h,v 1.12 2010/03/05 11:11:06 stoecker Exp $
   Copyright (C) 2005-2006 by Dirk Stöcker <stoecker@alberding.eu>
 
@@ -24,4 +24,6 @@
 
 #include <stdio.h>
+
+#define GNSS_MAXSATS 64
 
 #define PRN_GPS_START             1
@@ -114,10 +116,10 @@
   int    numsats;
   double timeofweek;         /* milliseconds in GPS week */
-  double measdata[24][GNSSENTRY_NUMBER];  /* data fields */ 
-  int    dataflags[24];      /* GPSDF_xxx */
-  int    satellites[24];     /* SV - IDs */
-  int    channels[24];       /* Glonass channels - valid of Glonass SV only */
-  int    snrL1[24];          /* Important: all the 5 SV-specific fields must */
-  int    snrL2[24];          /* have the same SV-order */
+  double measdata[GNSS_MAXSATS][GNSSENTRY_NUMBER];  /* data fields */ 
+  int    dataflags[GNSS_MAXSATS];      /* GPSDF_xxx */
+  int    satellites[GNSS_MAXSATS];     /* SV - IDs */
+  int    channels[GNSS_MAXSATS];       /* Glonass channels - valid of Glonass SV only */
+  int    snrL1[GNSS_MAXSATS];          /* Important: all the 5 SV-specific fields must */
+  int    snrL2[GNSS_MAXSATS];          /* have the same SV-order */
 };
 
