From e1807715c38f5534c8eae6327d67e3790f395749 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 4 Jul 2024 16:08:36 +0200 Subject: [PATCH] epgview.cpp: Fix warning about ignored 'nodiscard' attribute in show method Changed the for-loop in the show method of CEpgData class to properly check both conditions using the logical AND operator. This should ensure that the return value of 'operator!=' is not ignored, which addresses the compiler warning about the 'nodiscard' [-Wunused-result]. - Replaced ',' with '&&' in the loop condition. --- src/gui/epgview.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 83345593d..8d5ac4b77 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -811,11 +811,12 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // 21.07.2005 - rainerk // Show extended information - if ( !epgData.itemDescriptions.empty() && !epgData.items.empty()) { + if (!epgData.itemDescriptions.empty() && !epgData.items.empty()) { char line[256]; std::vector::iterator description; std::vector::iterator item; - for (description = epgData.itemDescriptions.begin(), item = epgData.items.begin(); description != epgData.itemDescriptions.end(), item != epgData.items.end(); ++description, ++item) { + for (description = epgData.itemDescriptions.begin(), item = epgData.items.begin(); description != epgData.itemDescriptions.end() && item != epgData.items.end(); ++description, ++item) + { sprintf(line, "%s: %s", (*(description)).c_str(), (*(item)).c_str()); processTextToArray(line); }