From 4913d4802c471f78195383a376a55b6c97bd13aa Mon Sep 17 00:00:00 2001 From: 8dcc <8dcc.git@gmail.com> Date: Sat, 22 Jul 2023 15:48:01 +0200 Subject: [PATCH] Fix globals_store and globals_restore --- src/globals.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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)); }