trau_pcu_ericsson: fix broken length check
The length check bits_len - offs < 0 does not work properly with
unsigned variables. Lets rearange this so that it works.
Change-Id: I9e0cd5d36c517b9198e0dc1bec0477a2ee2fb869
Fixes: CID#307058, CID#307057
diff --git a/src/trau/trau_pcu_ericsson.c b/src/trau/trau_pcu_ericsson.c
index 9292f23..fa0d5da 100644
--- a/src/trau/trau_pcu_ericsson.c
+++ b/src/trau/trau_pcu_ericsson.c
@@ -270,7 +270,7 @@
* greater then the length of the bits */
if (bits_len > bits_map_len)
return -EINVAL;
- if (bits_len - offs < 0)
+ if (bits_len <= offs)
return -EINVAL;
/* Advance to the position where the data is stored */
@@ -331,7 +331,7 @@
/* (see above) */
if (bits_len > bits_map_len)
return -EINVAL;
- if (bits_len - offs < 0)
+ if (bits_len <= offs)
return -EINVAL;
/* Advance to the position where the data is located */