diff --git a/src/globals.c b/src/globals.c index 7d85944..0c6593e 100644 --- a/src/globals.c +++ b/src/globals.c @@ -1,5 +1,6 @@ #include +#include #include #include "include/globals.h" @@ -43,13 +44,11 @@ bool globals_init(void) { } void globals_store(void) { - o_engine = *i_engine; - o_client = *i_client; - o_pmove = *i_pmove; + memcpy(&o_engine, i_engine, sizeof(cl_enginefunc_t)); + memcpy(&o_client, i_client, sizeof(cl_clientfunc_t)); } void globals_restore(void) { - *i_engine = o_engine; - *i_client = o_client; - *i_pmove = o_pmove; + memcpy(i_engine, &o_engine, sizeof(cl_enginefunc_t)); + memcpy(i_client, &o_client, sizeof(cl_clientfunc_t)); }