(wayland_ctx.c) Prevent implicit memsets

This commit is contained in:
twinaphex 2016-11-06 18:47:50 +01:00
parent 695ff2a299
commit aaefa8d59e

View File

@ -399,11 +399,13 @@ static bool gfx_ctx_wl_set_resize(void *data, unsigned width, unsigned height)
static void gfx_ctx_wl_update_window_title(void *data)
{
char buf[128] = {0};
char buf_fps[128] = {0};
char buf[128];
char buf_fps[128];
settings_t *settings = config_get_ptr();
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;
buf[0] = buf_fps[0] = '\0';
if (video_monitor_get_fps(buf, sizeof(buf),
buf_fps, sizeof(buf_fps)))
wl_shell_surface_set_title(wl->shell_surf, buf);
@ -417,7 +419,8 @@ static bool gfx_ctx_wl_get_metrics(void *data,
enum display_metric_types type, float *value)
{
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;
if (wl->physical_width == 0 || wl->physical_height == 0)
if (!wl || wl->physical_width == 0 || wl->physical_height == 0)
return false;
switch (type)