diff options
-rw-r--r-- | include/osmocore/msgb.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/osmocore/msgb.h b/include/osmocore/msgb.h index 6fd24c7f..c4f44305 100644 --- a/include/osmocore/msgb.h +++ b/include/osmocore/msgb.h @@ -22,6 +22,7 @@ #include <stdint.h> #include "linuxlist.h" +#include "utils.h" #define MSGB_DEBUG @@ -180,6 +181,8 @@ static inline void msgb_reserve(struct msgb *msg, int len) static inline struct msgb *msgb_alloc_headroom(int size, int headroom, const char *name) { + static_assert(size > headroom, headroom_bigger); + struct msgb *msg = msgb_alloc(size, name); if (msg) msgb_reserve(msg, headroom); |