From 1ac6a528411937e4e6cfbf5245f0a155e8e0608e Mon Sep 17 00:00:00 2001 From: Hendi Date: Wed, 25 Jan 2023 22:37:07 +0100 Subject: [PATCH] Fix string truncation warning Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/eb0f439a295fc94bac118cc890a4fb55a182fc4c Author: Hendi Date: 2023-01-25 (Wed, 25 Jan 2023) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/timerlist.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index c6f97591e..90406bb8f 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1685,7 +1685,8 @@ int CTimerList::modifyTimer() if (!strlen(timer->recordingDir)) strncpy(timer->recordingDir, g_settings.network_nfs_recordingdir.c_str(), sizeof(timer->recordingDir) - 1); timer_recordingDir = timer->recordingDir; - strncpy(t_old.recordingDir, timer->recordingDir, sizeof(t_old.recordingDir)); + static_assert(sizeof(t_old.recordingDir) >= sizeof(timer->recordingDir)); + memcpy(t_old.recordingDir, timer->recordingDir, strlen(timer->recordingDir) + 1); bool recDirEnabled = (g_settings.recording_type == CNeutrinoApp::RECORDING_FILE); CMenuForwarder *m6 = new CMenuForwarder(LOCALE_TIMERLIST_RECORDING_DIR, recDirEnabled, timer_recordingDir, this, "rec_dir1", CRCInput::RC_green);