]> sigrok.org Git - libsigrok.git/commitdiff
dreamsourcelab-dslogic: Drop an assert().
authorUwe Hermann <redacted>
Wed, 21 Jun 2017 06:00:51 +0000 (08:00 +0200)
committerUwe Hermann <redacted>
Wed, 21 Jun 2017 16:02:50 +0000 (18:02 +0200)
src/hardware/dreamsourcelab-dslogic/protocol.c

index cf6272b68b5e2bba30394a1ada9045b8a3d8f461..b5ca61b77e36efc80fabb17398bebd99fcc20fc1 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 #include <config.h>
-#include <assert.h>
 #include <math.h>
 #include <glib.h>
 #include <glib/gstdio.h>
@@ -859,7 +858,8 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer)
                 *
                 * Hopefully in future it will be possible to pass the data on as-is.
                 */
-               assert(transfer->actual_length % (DSLOGIC_ATOMIC_BYTES * channel_count) == 0);
+               if (transfer->actual_length % (DSLOGIC_ATOMIC_BYTES * channel_count) != 0)
+                       sr_err("Invalid transfer length!");
                deinterleave_buffer(transfer->buffer, transfer->actual_length,
                        devc->deinterleave_buffer, channel_count, channel_mask);