diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-03-09 02:13:26 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-03-09 02:13:26 +0100 |
commit | 934bcc133abf774947070492a5f31677c9400c0d (patch) | |
tree | 855c4cae5def842318b3617055175390e6eb8287 | |
parent | 1f39476f289cd6ac1f45da7f0d9b528b4bc9a978 (diff) | |
download | ipecamera-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); } |