Skip to content

Commit f2a3ff3

Browse files
authored
Merge pull request #75 from BlueAndi/bugfix/logging
Bugfix/logging
2 parents a0ff3e5 + ff776a8 commit f2a3ff3

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

lib/Utilities/src/Logging.cpp

+10-7
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,17 @@ bool Logging::selectSink(const String& name)
114114

115115
while ((MAX_SINKS > index) && (false == status))
116116
{
117-
if (m_sinks[index]->getName() == name)
117+
if (nullptr != m_sinks[index])
118118
{
119-
m_selectedSink = m_sinks[index];
120-
status = true;
121-
}
122-
else
123-
{
124-
++index;
119+
if (m_sinks[index]->getName() == name)
120+
{
121+
m_selectedSink = m_sinks[index];
122+
status = true;
123+
}
124+
else
125+
{
126+
++index;
127+
}
125128
}
126129
}
127130

lib/Utilities/src/Logging.h

+1-7
Original file line numberDiff line numberDiff line change
@@ -359,14 +359,8 @@ class Logging
359359
/**
360360
* Construct Logging.
361361
*/
362-
Logging() : m_currentLogLevel(LOG_LEVEL_INFO), m_sinks(), m_selectedSink(nullptr)
362+
Logging() : m_currentLogLevel(LOG_LEVEL_INFO), m_sinks{nullptr}, m_selectedSink(nullptr)
363363
{
364-
uint8_t index = 0U;
365-
366-
for (index = 0U; index < MAX_SINKS; ++index)
367-
{
368-
m_sinks[index] = nullptr;
369-
}
370364
}
371365

372366
/**

0 commit comments

Comments
 (0)