mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-07-28 10:52:02 +00:00
[client] main: fix release build uninitalized value warning
This commit is contained in:
@@ -1590,15 +1590,20 @@ static int lg_run(void)
|
|||||||
if (g_params.captureOnStart)
|
if (g_params.captureOnStart)
|
||||||
core_setGrab(true);
|
core_setGrab(true);
|
||||||
|
|
||||||
uint32_t udataSize;
|
uint32_t udataSize = 0;
|
||||||
uint32_t remoteVersion;
|
uint32_t remoteVersion = 0;
|
||||||
KVMFR *udata;
|
KVMFR * udata = NULL;
|
||||||
|
bool sessionReady = false;
|
||||||
int waitCount = 0;
|
int waitCount = 0;
|
||||||
|
|
||||||
MsgBoxHandle msgs[10];
|
MsgBoxHandle msgs[10];
|
||||||
int msgsCount;
|
int msgsCount;
|
||||||
|
|
||||||
restart:
|
restart:
|
||||||
|
udataSize = 0;
|
||||||
|
remoteVersion = 0;
|
||||||
|
udata = NULL;
|
||||||
|
sessionReady = false;
|
||||||
msgsCount = 0;
|
msgsCount = 0;
|
||||||
memset(msgs, 0, sizeof(msgs));
|
memset(msgs, 0, sizeof(msgs));
|
||||||
|
|
||||||
@@ -1719,8 +1724,10 @@ restart:
|
|||||||
// dont show warnings again after the first successful startup
|
// dont show warnings again after the first successful startup
|
||||||
waitCount = 100;
|
waitCount = 100;
|
||||||
|
|
||||||
const bool magicMatches = memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) == 0;
|
const bool headerValid = udata && udataSize >= sizeof(*udata);
|
||||||
if (udataSize < sizeof(*udata) || !magicMatches || udata->version != KVMFR_VERSION)
|
const bool magicMatches = headerValid &&
|
||||||
|
memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) == 0;
|
||||||
|
if (!headerValid || !magicMatches || udata->version != KVMFR_VERSION)
|
||||||
{
|
{
|
||||||
static bool alertsDone = false;
|
static bool alertsDone = false;
|
||||||
if (alertsDone)
|
if (alertsDone)
|
||||||
@@ -1765,10 +1772,11 @@ restart:
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sessionReady = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (app_getState() != APP_STATE_RUNNING)
|
if (!sessionReady || app_getState() != APP_STATE_RUNNING)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* close any informational message boxes from above as we now connected
|
/* close any informational message boxes from above as we now connected
|
||||||
|
|||||||
Reference in New Issue
Block a user