mirror of https://gerrit.osmocom.org/libosmocore
msgb: make msgb_get() finally work as expected
This commit is contained in:
parent
42645d7d78
commit
cac3cd6fcd
|
@ -224,7 +224,7 @@ static inline void msgb_put_u32(struct msgb *msgb, uint32_t word)
|
||||||
*/
|
*/
|
||||||
static inline unsigned char *msgb_get(struct msgb *msgb, unsigned int len)
|
static inline unsigned char *msgb_get(struct msgb *msgb, unsigned int len)
|
||||||
{
|
{
|
||||||
unsigned char *tmp = msgb->data - len;
|
unsigned char *tmp = msgb->tail - len;
|
||||||
if (msgb_length(msgb) < len)
|
if (msgb_length(msgb) < len)
|
||||||
MSGB_ABORT(msgb, "msgb too small to get %u (len %u)\n",
|
MSGB_ABORT(msgb, "msgb too small to get %u (len %u)\n",
|
||||||
len, msgb_length(msgb));
|
len, msgb_length(msgb));
|
||||||
|
|
Loading…
Reference in New Issue