Skip to content

Commit

Permalink
ss7ops: Solely rely on odd/even indicator for BCD decoding
Browse files Browse the repository at this point in the history
In contrast to GSM we want to see the 'F' digits. Rely on the
odd/even indicator to see if the last nibble should be parsed
or not.
  • Loading branch information
zecke committed Nov 16, 2016
1 parent 9a1547e commit 7be63c5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/ss7ops/isup_parsed.c
Expand Up @@ -180,14 +180,12 @@ static inline void decode_bcd(char *dest, const uint8_t *data, size_t len, int o
uint8_t lo = data[i] & 0x0F;
uint8_t hi = (data[i] & 0xF0) >> 4;

if (lo != 0x0F)
*dest++ = from_bcd(lo);
*dest++ = from_bcd(lo);

/* ignore the last digit */
if (i + 1 == len && odd)
break;
if (hi != 0x0F)
*dest++ = from_bcd(hi);
*dest++ = from_bcd(hi);
}
*dest = '\0';
}
Expand Down

0 comments on commit 7be63c5

Please sign in to comment.