mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-11 18:08:08 +00:00
[client] use variable-relative sizeof where possible
This commit is contained in:

committed by
Geoffrey McRae

parent
1c5620ba25
commit
14ad83c6b8
@@ -135,14 +135,14 @@ static void cursorTexFree(struct CursorTex * t)
|
||||
|
||||
bool egl_cursorInit(EGL_Cursor ** cursor)
|
||||
{
|
||||
*cursor = (EGL_Cursor *)malloc(sizeof(EGL_Cursor));
|
||||
*cursor = (EGL_Cursor *)malloc(sizeof(**cursor));
|
||||
if (!*cursor)
|
||||
{
|
||||
DEBUG_ERROR("Failed to malloc EGL_Cursor");
|
||||
return false;
|
||||
}
|
||||
|
||||
memset(*cursor, 0, sizeof(EGL_Cursor));
|
||||
memset(*cursor, 0, sizeof(**cursor));
|
||||
LG_LOCK_INIT((*cursor)->lock);
|
||||
|
||||
if (!cursorTexInit(&(*cursor)->norm,
|
||||
|
Reference in New Issue
Block a user