From 822cbbbc8b372c557649891aa84ed63c839965e5 Mon Sep 17 00:00:00 2001 From: comex Date: Fri, 8 Aug 2025 14:13:09 -0700 Subject: [PATCH] daybreak: fix strncpy compiler warning GCC warned that the output string would not be nul-terminated if the input string was too long. Fix this by subtracting 1 from the size argument, as is done for other `strncpy` calls in the file. (It would probably be better to avoid `strncpy` entirely, but this is just a simple fix.) --- troposphere/daybreak/source/ui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/troposphere/daybreak/source/ui.cpp b/troposphere/daybreak/source/ui.cpp index 693063ea6..1e63f8811 100644 --- a/troposphere/daybreak/source/ui.cpp +++ b/troposphere/daybreak/source/ui.cpp @@ -1277,7 +1277,7 @@ namespace dbk { if (InitializeMenu(screen_width, screen_height)) { /* Set the update path. */ - strncpy(g_update_path, update_path, sizeof(g_update_path)); + strncpy(g_update_path, update_path, sizeof(g_update_path)-1); /* Change the menu. */ ChangeMenu(std::make_shared(g_current_menu));