From 544333415680b5affcba83463c686c984b5231da Mon Sep 17 00:00:00 2001 From: Carter Li Date: Tue, 29 Oct 2024 08:51:44 +0800 Subject: [PATCH] DisplayServer (Linux): silense compiler warnings --- src/detection/displayserver/linux/wayland/kde-output.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/detection/displayserver/linux/wayland/kde-output.c b/src/detection/displayserver/linux/wayland/kde-output.c index 1c4576dd4..beac7b635 100644 --- a/src/detection/displayserver/linux/wayland/kde-output.c +++ b/src/detection/displayserver/linux/wayland/kde-output.c @@ -113,7 +113,11 @@ static void waylandKdeNameListener(void* data, FF_MAYBE_UNUSED struct kde_output WaylandDisplay* display = data; display->type = ffdsGetDisplayType(name); // As display->id is used as an internal identifier, we don't need it to be NUL terminated + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstringop-truncation" strncpy((char*) &display->id, name, sizeof(display->id)); + #pragma GCC diagnostic pop + ffStrbufAppendS(&display->name, name); }