Skip to content

Commit f282bc3

Browse files
committed
Fix. static assert. now only magic field should match
1 parent d2d771f commit f282bc3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lceasy.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,9 +1051,8 @@ void lcurl_easy_initlib(lua_State *L, int nup){
10511051
/* Hack. We ensure that lcurl_easy_t and lcurl_hpost_stream_t
10521052
compatiable for readfunction
10531053
*/
1054-
LCURL_STATIC_ASSERT(offsetof(lcurl_easy_t, L) == offsetof(lcurl_hpost_stream_t, L));
1055-
LCURL_STATIC_ASSERT(offsetof(lcurl_easy_t, rd) == offsetof(lcurl_hpost_stream_t, rd));
1056-
LCURL_STATIC_ASSERT(offsetof(lcurl_easy_t, rbuffer) == offsetof(lcurl_hpost_stream_t, rbuffer));
1054+
LCURL_STATIC_ASSERT(offsetof(lcurl_easy_t, magic) == offsetof(lcurl_hpost_stream_t, magic));
1055+
LCURL_STATIC_ASSERT(sizeof(((lcurl_easy_t*)0)->magic) == sizeof(((lcurl_hpost_stream_t*)0)->magic));
10571056

10581057
if(!lutil_createmetap(L, LCURL_EASY, lcurl_easy_methods, nup))
10591058
lua_pop(L, nup);

0 commit comments

Comments
 (0)