summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-05-16 11:25:12 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-05-16 11:25:12 +0000
commitffa2b0a23afbb3616fd6f1fc9ec89cd116b61675 (patch)
tree2b056532325bb61763bf7a06a19d0a67b4327bcb
parent211002ea1a8e4b94afebc67f5b13eff46e09eb6e (diff)
Fix length calculation for complex data
-rw-r--r--tools/csr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/csr.c b/tools/csr.c
index 6ed0a08f..d1932cf4 100644
--- a/tools/csr.c
+++ b/tools/csr.c
@@ -401,7 +401,7 @@ char *csr_pskeytostr(uint16_t pskey)
int csr_read_varid_complex(int dd, uint16_t seqnum, uint16_t varid, uint8_t *value, uint16_t length)
{
- unsigned char cmd[] = { 0x00, 0x00, (length + 5) & 0xff, (length + 5) >> 8,
+ unsigned char cmd[] = { 0x00, 0x00, ((length / 2) + 5) & 0xff, ((length / 2) + 5) >> 8,
seqnum & 0xff, seqnum >> 8, varid & 0xff, varid >> 8, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };