]> sigrok.org Git - libsigrok.git/blobdiff - hardware/asix-sigma/asix-sigma.c
asix-sigma: fix incorrect pointer cast (non-aligned memory and endiannes issue)
[libsigrok.git] / hardware / asix-sigma / asix-sigma.c
index 70a9d7731d35e50e249c213680b29e8f822fa7ab..a7a1d46a1d66da61df5a032f68bae31a1585fb39 100644 (file)
@@ -1061,7 +1061,7 @@ static int receive_data(int fd, int revents, void *cb_data)
 
                /* Find first ts. */
                if (devc->state.chunks_downloaded == 0) {
-                       devc->state.lastts = *(uint16_t *) buf - 1;
+                       devc->state.lastts = RL16(buf) - 1;
                        devc->state.lastsample = 0;
                }