summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-03-09 02:13:26 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-03-09 02:13:26 +0100
commit934bcc133abf774947070492a5f31677c9400c0d (patch)
tree855c4cae5def842318b3617055175390e6eb8287
parent1f39476f289cd6ac1f45da7f0d9b528b4bc9a978 (diff)
downloadipecamera-934bcc133abf774947070492a5f31677c9400c0d.tar.gz
ipecamera-934bcc133abf774947070492a5f31677c9400c0d.tar.bz2
ipecamera-934bcc133abf774947070492a5f31677c9400c0d.tar.xz
ipecamera-934bcc133abf774947070492a5f31677c9400c0d.zip
Fixes write verification failure if byte-swapping is in force
-rw-r--r--cli.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cli.c b/cli.c
index 3540239..8a78a7a 100644
--- a/cli.c
+++ b/cli.c
@@ -442,10 +442,10 @@ int WriteData(pcilib_t *handle, pcilib_bar_t bar, uintptr_t addr, size_t n, acce
if (endianess) pcilib_swap(buf, buf, abs(access), n);
pcilib_write(handle, bar, addr, size, buf);
pcilib_read(handle, bar, addr, size, check);
- if (endianess) pcilib_swap(check, check, abs(access), n);
if (memcmp(buf, check, size)) {
printf("Write failed: the data written and read differ, the foolowing is read back:\n");
+ if (endianess) pcilib_swap(check, check, abs(access), n);
ReadData(handle, bar, addr, n, access, endianess);
exit(-1);
}