Review at  https://gerrit.osmocom.org/5614

coding: move eB adjustement to appropriate place

As a leftover from code move from OsmoBTS we have eB adjustement outside
of eB check in gsm0503_tch_burst_map() which is rightfully noted by
Coverity. Let's fix this by moving the adjustement under the
corresponding if.

Change-Id: I385cd6ffea4d13ef911910fc87c92b73809888a2
Fixes: CID57691
---
M src/coding/gsm0503_mapping.c
1 file changed, 2 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/14/5614/1

diff --git a/src/coding/gsm0503_mapping.c b/src/coding/gsm0503_mapping.c
index 1e37fce..f7532eb 100644
--- a/src/coding/gsm0503_mapping.c
+++ b/src/coding/gsm0503_mapping.c
@@ -92,13 +92,8 @@
                        eB[i] = iB[i];
                for (i = 58 - odd; i < 114; i += 2)
                        eB[i + 2] = iB[i];
-       }
-
-       if (h) {
-               if (!odd)
-                       eB[58] = *h;
-               else
-                       eB[57] = *h;
+               if (h)
+                       eB[odd ? 57 : 58] = *h;
        }
 }
 

-- 
To view, visit https://gerrit.osmocom.org/5614
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I385cd6ffea4d13ef911910fc87c92b73809888a2
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max <[email protected]>

Reply via email to