1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

ng_pktbuf_static: enhance _pktbuf_contains

This commit is contained in:
Cenk Gündoğan 2015-07-31 18:25:12 +02:00
parent 4c4e54ad34
commit b475bfd8f0

View File

@ -52,8 +52,7 @@ static void _pktbuf_free(void *data, size_t size);
static inline bool _pktbuf_contains(void *ptr)
{
return (&_pktbuf[0] <= (uint8_t *)ptr) &&
((uint8_t *)ptr <= &_pktbuf[NG_PKTBUF_SIZE - 1]);
return (unsigned)((uint8_t *)ptr - _pktbuf) < NG_PKTBUF_SIZE;
}
/* fits size to byte alignment */