aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-09-10 20:58:20 +0200
committerHarald Welte <laforge@gnumonks.org>2014-10-26 19:08:43 +0100
commitcac3cd6fcd941ae0906e5a95a1cb3b5ebec8a72a (patch)
treebff0a1dbb99425c458dff391a66cbdbae5757b7e
parent42645d7d78a22db7b76039407b7b43bc0cc79c54 (diff)
msgb: make msgb_get() finally work as expected
-rw-r--r--include/osmocom/core/msgb.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h
index 19e4a3d0..644a6391 100644
--- a/include/osmocom/core/msgb.h
+++ b/include/osmocom/core/msgb.h
@@ -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)
{
- unsigned char *tmp = msgb->data - len;
+ unsigned char *tmp = msgb->tail - len;
if (msgb_length(msgb) < len)
MSGB_ABORT(msgb, "msgb too small to get %u (len %u)\n",
len, msgb_length(msgb));