audioplayer.cpp: reduce warning: ‘%ld’ directive output may be truncated writing between

Origin commit data
------------------
Branch: ni/coolstream
Commit: 43d11383a6
Author: max_10 <max_10@gmx.de>
Date: 2021-11-14 (Sun, 14 Nov 2021)

Origin message was:
------------------
- audioplayer.cpp: reduce warning: ‘%ld’ directive output may be truncated writing between

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
max_10
2021-11-14 22:12:28 +01:00
committed by vanhofen
parent c53958ea91
commit a300d0dd4e

View File

@@ -1695,7 +1695,7 @@ void CAudioPlayerGui::paintItem(int pos)
snprintf(dura, sizeof(dura), "%ldk", m_playlist[currpos].MetaData.total_time); snprintf(dura, sizeof(dura), "%ldk", m_playlist[currpos].MetaData.total_time);
} }
else else
snprintf(dura, sizeof(dura), "%ld:%02ld", m_playlist[currpos].MetaData.total_time / 60, m_playlist[currpos].MetaData.total_time % 60); snprintf(dura, sizeof(dura), "%zu:%02ld", m_playlist[currpos].MetaData.total_time / 60, m_playlist[currpos].MetaData.total_time % 60);
int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(dura); int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(dura);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + OFFSET_INNER_MID, ypos + m_item_height, m_width - SCROLLBAR_WIDTH - 3*OFFSET_INNER_MID - w, tmp, color, m_item_height); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + OFFSET_INNER_MID, ypos + m_item_height, m_width - SCROLLBAR_WIDTH - 3*OFFSET_INNER_MID - w, tmp, color, m_item_height);
@@ -2350,9 +2350,9 @@ void CAudioPlayerGui::updateTimes(const bool force)
if (!CScreenSaver::getInstance()->isActive()) if (!CScreenSaver::getInstance()->isActive())
{ {
char total_time[17]; char total_time[17];
snprintf(total_time, sizeof(total_time), " / %ld:%02ld", m_time_total / 60, m_time_total % 60); snprintf(total_time, sizeof(total_time), " / %zu:%02ld", m_time_total / 60, m_time_total % 60);
char played_time[14]; char played_time[14];
snprintf(played_time, sizeof(played_time), "%ld:%02ld", m_time_played / 60, m_time_played % 60); snprintf(played_time, sizeof(played_time), "%zu:%02ld", m_time_played / 60, m_time_played % 60);
int w_total_time = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(total_time); int w_total_time = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(total_time);
int w_faked_time = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("000:00"); int w_faked_time = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("000:00");