X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/003db17f7a36a8098827f40df8fedc087b5a26f6..77e7b21f117eecd04bb31257ee68dfc1f425a47e:/lunaix-os/includes/lunaix/common.h?ds=sidebyside diff --git a/lunaix-os/includes/lunaix/common.h b/lunaix-os/includes/lunaix/common.h index 7fdf0b3..d341daa 100644 --- a/lunaix-os/includes/lunaix/common.h +++ b/lunaix-os/includes/lunaix/common.h @@ -48,7 +48,7 @@ #define container_of(ptr, type, member) \ ({ \ const typeof(((type*)0)->member)* __mptr = (ptr); \ - (type*)((char*)__mptr - offsetof(type, member)); \ + (ptr) ? (type*)((char*)__mptr - offsetof(type, member)) : 0; \ }) #endif