From 4b7d44d015e192fa9e589bb772eddf6fe0a2f3b5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 15 Feb 2024 18:18:28 +1100 Subject: [PATCH] Fix incorrect use of sizeof() for Wayland The size of the string in bytes happened to match the the pointer size on 64bit systems, nevertheless the logic was wrong would would fail on 32bit systems. Also use a character to search the string instead of a single character string. --- intern/ghost/intern/GHOST_SystemWayland.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemWayland.cc b/intern/ghost/intern/GHOST_SystemWayland.cc index f79f131acb0..fd7f6c5a515 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.cc +++ b/intern/ghost/intern/GHOST_SystemWayland.cc @@ -3286,10 +3286,10 @@ static void data_device_handle_drop(void *data, wl_data_device * /*wl_data_devic GHOST_SystemWayland *const system = seat->system; if (mime_receive == ghost_wl_mime_text_uri) { - static constexpr const char *file_proto = "file://"; + const char file_proto[] = "file://"; /* NOTE: some applications CRLF (`\r\n`) GTK3 for e.g. & others don't `pcmanfm-qt`. * So support both, once `\n` is found, strip the preceding `\r` if found. */ - static constexpr const char *lf = "\n"; + const char lf = '\n'; GHOST_WindowWayland *win = ghost_wl_surface_user_data(wl_surface_window); std::vector uris;