From 3fcd38dcd9f704c307da815f39c23f3e0581ef3e Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Mon, 3 Oct 2011 12:52:24 +0200 Subject: [PATCH] fixed return value check of m_communication->Write() --- src/lib/CECParser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/CECParser.cpp b/src/lib/CECParser.cpp index 4cbdd6c..1eaa1f5 100644 --- a/src/lib/CECParser.cpp +++ b/src/lib/CECParser.cpp @@ -379,7 +379,7 @@ void CCECParser::BroadcastActiveSource(void) bool CCECParser::TransmitFormatted(const cec_frame &data, bool bWaitForAck /* = true */) { - if (!m_communication || m_communication->Write(data) != data.size()) + if (!m_communication || !m_communication->Write(data)) return false; CCondition::Sleep((int) data.size() * 24 /*data*/ + 5 /*start bit (4.5 ms)*/ + 50 /* to be on the safe side */); @@ -709,7 +709,7 @@ bool CCECParser::SetAckMask(uint16_t iMask) PushEscaped(output, (uint8_t)iMask); output.push_back(MSGEND); - if (m_communication->Write(output) == -1) + if (!m_communication->Write(output)) { AddLog(CEC_LOG_ERROR, "could not set the ackmask"); return false; -- 2.34.1