Index: trunk/rtcm3torinex/rtcm3torinex.c
===================================================================
--- trunk/rtcm3torinex/rtcm3torinex.c	(revision 1087)
+++ trunk/rtcm3torinex/rtcm3torinex.c	(revision 1088)
@@ -1,5 +1,5 @@
 /*
   Converter for RTCM3 data to RINEX.
-  $Id: rtcm3torinex.c,v 1.28 2008/06/20 06:15:25 stoecker Exp $
+  $Id: rtcm3torinex.c,v 1.29 2008/07/22 15:15:51 stoecker Exp $
   Copyright (C) 2005-2008 by Dirk Stöcker <stoecker@alberding.eu>
 
@@ -51,5 +51,5 @@
 
 /* CVS revision and version */
-static char revisionstr[] = "$Revision: 1.28 $";
+static char revisionstr[] = "$Revision: 1.30 $";
 
 #ifndef COMPILEDATE
@@ -436,8 +436,8 @@
         GETBITS(syncf,1) /* sync */
         GETBITS(i,5)
-        gnss->numsats = i;
+        gnss->numsats += i;
         SKIPBITS(4) /* smind, smint */
 
-        for(num = 0; num < gnss->numsats; ++num)
+        for(num = gnss->numsats-i; num < gnss->numsats; ++num)
         {
           int sv, code, l1range, c,l,s,ce,le,se,amb=0;
@@ -834,5 +834,5 @@
   if(u) *u = user;
   return 1+snprintf(buffer, buffersize,
-  rinex3 ? 
+  rinex3 ?
   "RTCM3TORINEX %-7.7s%-20.20s%04d%02d%02d %02d%02d%02d UTC "
   "PGM / RUN BY / DATE" :
@@ -1532,5 +1532,5 @@
 
 #ifndef NO_RTCM3_MAIN
-static char datestr[]     = "$Date: 2008/06/20 06:15:25 $";
+static char datestr[]     = "$Date: 2008/07/22 15:15:51 $";
 
 /* The string, which is send as agent in HTTP request */
@@ -1933,5 +1933,5 @@
   if(getargs(argc, argv, &args))
   {
-    int sockfd, numbytes;  
+    int sockfd, numbytes;
     char buf[MAXDATASIZE];
     struct sockaddr_in their_addr; /* connector's address information */
@@ -2024,9 +2024,9 @@
       /* fill structure with local address information for UDP */
       memset(&local, 0, sizeof(local));
-      local.sin_family = AF_INET;  	
+      local.sin_family = AF_INET;
       local.sin_port = htons(0);
-      local.sin_addr.s_addr = htonl(INADDR_ANY); 
+      local.sin_addr.s_addr = htonl(INADDR_ANY);
       len = sizeof(local);
-      /* bind() in order to get a random RTP client_port */ 
+      /* bind() in order to get a random RTP client_port */
       if((bind(sockudp, (struct sockaddr *)&local, len)) < 0)
       {
@@ -2034,11 +2034,11 @@
         exit(1);
       }
-      if((getsockname(sockudp, (struct sockaddr*)&local, &len)) != -1) 
-      {
-        localport = ntohs(local.sin_port); 
+      if((getsockname(sockudp, (struct sockaddr*)&local, &len)) != -1)
+      {
+        localport = ntohs(local.sin_port);
       }
       else
       {
-        perror("local access failed"); 
+        perror("local access failed");
         exit(1);
       }
@@ -2050,6 +2050,6 @@
       }
       i=snprintf(buf, MAXDATASIZE-40, /* leave some space for login */
-      "SETUP rtsp://%s%s%s/%s RTSP/1.0\r\n" 	        
-      "CSeq: %d\r\n"		
+      "SETUP rtsp://%s%s%s/%s RTSP/1.0\r\n"
+      "CSeq: %d\r\n"
       "Ntrip-Version: Ntrip/2.0\r\n"
       "Ntrip-Component: Ntripclient\r\n"
@@ -2145,8 +2145,8 @@
 
           i = snprintf(buf, MAXDATASIZE,
-          "PLAY rtsp://%s%s%s/%s RTSP/1.0\r\n"	        
+          "PLAY rtsp://%s%s%s/%s RTSP/1.0\r\n"
           "CSeq: %d\r\n"
           "Session: %d\r\n"
-          "\r\n", 
+          "\r\n",
           args.server, proxyserver ? ":" : "", proxyserver ? args.port : "",
           args.data, cseq++, session);
@@ -2169,5 +2169,5 @@
               /* fill structure with caster address information for UDP */
               memset(&addrRTP, 0, sizeof(addrRTP));
-              addrRTP.sin_family = AF_INET;  
+              addrRTP.sin_family = AF_INET;
               addrRTP.sin_port   = htons(serverport);
               their_addr.sin_addr = *((struct in_addr *)he->h_addr);
@@ -2211,8 +2211,8 @@
             }
             i = snprintf(buf, MAXDATASIZE,
-            "TEARDOWN rtsp://%s%s%s/%s RTSP/1.0\r\n"	        
+            "TEARDOWN rtsp://%s%s%s/%s RTSP/1.0\r\n"
             "CSeq: %d\r\n"
             "Session: %d\r\n"
-            "\r\n", 
+            "\r\n",
             args.server, proxyserver ? ":" : "", proxyserver ? args.port : "",
             args.data, cseq++, session);
