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:
parent
4c4e54ad34
commit
b475bfd8f0
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user