diff --git a/src/cressi_edy.c b/src/cressi_edy.c index 67ca985..732635c 100644 --- a/src/cressi_edy.c +++ b/src/cressi_edy.c @@ -275,8 +275,9 @@ cressi_edy_device_read (device_t *abstract, unsigned int address, unsigned char if (! device_is_cressi_edy (abstract)) return DEVICE_STATUS_TYPE_MISMATCH; - assert (address % (CRESSI_EDY_PACKET_SIZE / 4)== 0); - assert (size % CRESSI_EDY_PACKET_SIZE == 0); + if ((address % (CRESSI_EDY_PACKET_SIZE / 4) != 0) || + (size % CRESSI_EDY_PACKET_SIZE != 0)) + return DEVICE_STATUS_ERROR; // The data transmission is split in packages // of maximum $CRESSI_EDY_PACKET_SIZE bytes. diff --git a/src/oceanic_atom2.c b/src/oceanic_atom2.c index fc7fe70..8465eef 100644 --- a/src/oceanic_atom2.c +++ b/src/oceanic_atom2.c @@ -21,7 +21,6 @@ #include // memcpy #include // malloc, free -#include // assert #include "device-private.h" #include "oceanic_common.h" @@ -459,8 +458,9 @@ oceanic_atom2_device_read (device_t *abstract, unsigned int address, unsigned ch if (! device_is_oceanic_atom2 (abstract)) return DEVICE_STATUS_TYPE_MISMATCH; - assert (address % PAGESIZE == 0); - assert (size % PAGESIZE == 0); + if ((address % PAGESIZE != 0) || + (size % PAGESIZE != 0)) + return DEVICE_STATUS_ERROR; // The data transmission is split in packages // of maximum $PAGESIZE bytes. @@ -497,8 +497,9 @@ oceanic_atom2_device_write (device_t *abstract, unsigned int address, const unsi if (! device_is_oceanic_atom2 (abstract)) return DEVICE_STATUS_TYPE_MISMATCH; - assert (address % PAGESIZE == 0); - assert (size % PAGESIZE == 0); + if ((address % PAGESIZE != 0) || + (size % PAGESIZE != 0)) + return DEVICE_STATUS_ERROR; // The data transmission is split in packages // of maximum $PAGESIZE bytes. diff --git a/src/oceanic_veo250.c b/src/oceanic_veo250.c index 663c782..982c6b1 100644 --- a/src/oceanic_veo250.c +++ b/src/oceanic_veo250.c @@ -21,7 +21,6 @@ #include // memcpy #include // malloc, free -#include // assert #include "device-private.h" #include "oceanic_common.h" @@ -394,8 +393,9 @@ oceanic_veo250_device_read (device_t *abstract, unsigned int address, unsigned c if (! device_is_oceanic_veo250 (abstract)) return DEVICE_STATUS_TYPE_MISMATCH; - assert (address % PAGESIZE == 0); - assert (size % PAGESIZE == 0); + if ((address % PAGESIZE != 0) || + (size % PAGESIZE != 0)) + return DEVICE_STATUS_ERROR; // The data transmission is split in packages // of maximum $PAGESIZE bytes. diff --git a/src/oceanic_vtpro.c b/src/oceanic_vtpro.c index ac9545e..4cc0aca 100644 --- a/src/oceanic_vtpro.c +++ b/src/oceanic_vtpro.c @@ -21,7 +21,6 @@ #include // memcpy #include // malloc, free -#include // assert #include "device-private.h" #include "oceanic_common.h" @@ -462,8 +461,9 @@ oceanic_vtpro_device_read (device_t *abstract, unsigned int address, unsigned ch if (! device_is_oceanic_vtpro (abstract)) return DEVICE_STATUS_TYPE_MISMATCH; - assert (address % PAGESIZE == 0); - assert (size % PAGESIZE == 0); + if ((address % PAGESIZE != 0) || + (size % PAGESIZE != 0)) + return DEVICE_STATUS_ERROR; // The data transmission is split in packages // of maximum $PAGESIZE bytes.