From: hadaq Date: Tue, 19 Oct 2010 18:33:45 +0000 (+0000) Subject: Bug fix in rmt X-Git-Tag: v6.0~208 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=a29b11065a59667e42fd37b02e6cf938141b3307;p=trbnettools.git Bug fix in rmt --- diff --git a/libtrbnet/trbcmd.c b/libtrbnet/trbcmd.c index 7ce8d1e..dd3467a 100644 --- a/libtrbnet/trbcmd.c +++ b/libtrbnet/trbcmd.c @@ -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)); diff --git a/libtrbnet/trbnet.c b/libtrbnet/trbnet.c index 227a6fa..e81996c 100644 --- a/libtrbnet/trbnet.c +++ b/libtrbnet/trbnet.c @@ -1,4 +1,4 @@ -const char trbnet_version[] = "$Revision: 2.78 $"; +const char trbnet_version[] = "$Revision: 2.79 $"; #include #include @@ -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;