From 917ecca58ea8ec88a413982502108903066641f0 Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Fri, 18 Dec 2020 14:08:44 -0700 Subject: [PATCH] backend/drm: avoid gcc stringop-truncation warning --- backend/drm/drm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index bdd0b1e4..50256abd 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -1317,8 +1317,8 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) { wlr_output_init(&wlr_conn->output, &drm->backend, &output_impl, drm->display); - strncpy(wlr_conn->output.name, wlr_conn->name, - sizeof(wlr_conn->output.name) - 1); + memcpy(wlr_conn->output.name, wlr_conn->name, + sizeof(wlr_conn->output.name)); wlr_conn->output.phys_width = drm_conn->mmWidth; wlr_conn->output.phys_height = drm_conn->mmHeight;