]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
Bug fix in rmt
authorhadaq <hadaq>
Tue, 19 Oct 2010 18:33:45 +0000 (18:33 +0000)
committerhadaq <hadaq>
Tue, 19 Oct 2010 18:33:45 +0000 (18:33 +0000)
libtrbnet/trbcmd.c
libtrbnet/trbnet.c

index 7ce8d1eef9ac507b0b00a36e3b6e317c24bec26d..dd3467ae0aecbf3971360a1e12738b3dcd1637e3 100644 (file)
@@ -25,7 +25,7 @@
 
 static int hexMode = HEXMODE;
 
-static const char trbcmd_version[] = "$Revision: 2.58 $";
+static const char trbcmd_version[] = "$Revision: 2.59 $";
 
 #define BACKLOG 10
 static uint16_t tcp_port = 55555;
@@ -564,7 +564,7 @@ int start(int argc, char **argv)
           while (p < end) {
             len = (*p >> 16) & 0xffff;
             fprintf(stdout, "H: 0x%04x  0x%04x\n", (*p++) & 0xffff, len);
-            for (i = 0; (i < len) && (p < end); i++) {
+            for (i = 0; (i < len) && ((p + 1) < end); i++) {
               fprintf(stdout, "0x%04x  0x%08x  0x%04x\n",
                       (option == 0 ? reg_address + i : i),
                       *p, *(p + 1));
index 227a6fa02dda218e57f0c6942acf358f94ce567a..e81996c2949fefc35e623d395f048030ba90f653 100644 (file)
@@ -1,4 +1,4 @@
-const char trbnet_version[] = "$Revision: 2.78 $";
+const char trbnet_version[] = "$Revision: 2.79 $";
 
 #include <stdlib.h>
 #include <signal.h>
@@ -1459,7 +1459,7 @@ int trb_registertime_read_mem(uint16_t trb_address,
       trb_errno = TRB_READMEM_INVALID_SIZE;
       return -1;
     }
-    p += len + 1;
+    p += len * 2 + 1;
   }
 
   return status;