From 934bcc133abf774947070492a5f31677c9400c0d Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 9 Mar 2011 02:13:26 +0100 Subject: Fixes write verification failure if byte-swapping is in force --- cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli.c') 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); } -- cgit v1.2.3