This commit is contained in:
parent
bb66228837
commit
53535b6023
2
thirdparty/tas/hdlc.c
vendored
2
thirdparty/tas/hdlc.c
vendored
@ -67,6 +67,7 @@ int hdlc_remove_framing_with_crc_check(const uint8_t *src, size_t slen, uint8_t
|
|||||||
*dlen = 0;
|
*dlen = 0;
|
||||||
if (slen < 4) return -1;
|
if (slen < 4) return -1;
|
||||||
if ((src[tlen] != 0x7E) && (src[slen-1] != 0x7C)) return -2;
|
if ((src[tlen] != 0x7E) && (src[slen-1] != 0x7C)) return -2;
|
||||||
|
src++;
|
||||||
for (ii = 1; ii < slen-1; ii++)
|
for (ii = 1; ii < slen-1; ii++)
|
||||||
{
|
{
|
||||||
bt = *src++;
|
bt = *src++;
|
||||||
@ -74,6 +75,7 @@ int hdlc_remove_framing_with_crc_check(const uint8_t *src, size_t slen, uint8_t
|
|||||||
if (bt == 0x7D)
|
if (bt == 0x7D)
|
||||||
{
|
{
|
||||||
bt = *src++ ^ 0x20;
|
bt = *src++ ^ 0x20;
|
||||||
|
ii++;
|
||||||
}
|
}
|
||||||
dst[tlen++] = bt;
|
dst[tlen++] = bt;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user