From dbb11602ecddc04b644aa94eba842540f49fc152 Mon Sep 17 00:00:00 2001 From: Micke Prag Date: Tue, 19 Jun 2012 16:23:36 +0200 Subject: [PATCH] Temporarily suppress cpplint errors "runtime/printf" for sscanf(). We should prpbably remove them later --- telldus-core/service/ProtocolEverflourish.cpp | 3 ++- telldus-core/service/ProtocolNexa.cpp | 3 ++- telldus-core/service/ProtocolSartano.cpp | 3 ++- telldus-core/service/ProtocolWaveman.cpp | 3 ++- telldus-core/service/ProtocolX10.cpp | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/telldus-core/service/ProtocolEverflourish.cpp b/telldus-core/service/ProtocolEverflourish.cpp index 4b7866ec..aec6598c 100644 --- a/telldus-core/service/ProtocolEverflourish.cpp +++ b/telldus-core/service/ProtocolEverflourish.cpp @@ -101,7 +101,8 @@ std::string ProtocolEverflourish::decodeData(const ControllerMessage &dataMsg) { unsigned int unit = 0; unsigned int method = 0; - sscanf(data.c_str(), "%X", &allData); + // TODO(micke): Convert sscanf. This is slow and can overflow buffers! + sscanf(data.c_str(), "%X", &allData); // NOLINT(runtime/printf) house = allData & 0xFFFC00; house >>= 10; diff --git a/telldus-core/service/ProtocolNexa.cpp b/telldus-core/service/ProtocolNexa.cpp index baad51cc..a2cef58f 100644 --- a/telldus-core/service/ProtocolNexa.cpp +++ b/telldus-core/service/ProtocolNexa.cpp @@ -167,7 +167,8 @@ std::string ProtocolNexa::getStringSelflearningForCode(int intHouse, int intCode std::string ProtocolNexa::decodeData(const ControllerMessage& dataMsg) { uint32_t allData = 0; - sscanf(dataMsg.getParameter("data").c_str(), "%lx", reinterpret_cast(&allData)); // NOLINT(runtime/int) + // TODO(micke): Convert sscanf. This is slow and can overflow buffers! + sscanf(dataMsg.getParameter("data").c_str(), "%lx", reinterpret_cast(&allData)); // NOLINT if(TelldusCore::comparei(dataMsg.model(), L"selflearning")) { // selflearning diff --git a/telldus-core/service/ProtocolSartano.cpp b/telldus-core/service/ProtocolSartano.cpp index 90c95023..37035d71 100644 --- a/telldus-core/service/ProtocolSartano.cpp +++ b/telldus-core/service/ProtocolSartano.cpp @@ -50,7 +50,8 @@ std::string ProtocolSartano::decodeData(const ControllerMessage &dataMsg) { unsigned int method2 = 0; unsigned int method = 0; - sscanf(data.c_str(), "%X", &allDataIn); + // TODO(micke): Convert sscanf. This is slow and can overflow buffers! + sscanf(data.c_str(), "%X", &allDataIn); // NOLINT(runtime/printf) uint16_t mask = (1<<11); for(int i = 0; i < 12; ++i) { diff --git a/telldus-core/service/ProtocolWaveman.cpp b/telldus-core/service/ProtocolWaveman.cpp index 50d4985d..3f9c449f 100644 --- a/telldus-core/service/ProtocolWaveman.cpp +++ b/telldus-core/service/ProtocolWaveman.cpp @@ -30,7 +30,8 @@ std::string ProtocolWaveman::decodeData(const ControllerMessage& dataMsg) { unsigned int unit = 0; unsigned int method = 0; - sscanf(dataMsg.getParameter("data").c_str(), "%lx", reinterpret_cast(&allData)); // NOLINT(runtime/int) + // TODO(micke): Convert sscanf. This is slow and can overflow buffers! + sscanf(dataMsg.getParameter("data").c_str(), "%lx", reinterpret_cast(&allData)); // NOLINT method = allData & 0xF00; method >>= 8; diff --git a/telldus-core/service/ProtocolX10.cpp b/telldus-core/service/ProtocolX10.cpp index ea8d1b9c..40ddb27a 100644 --- a/telldus-core/service/ProtocolX10.cpp +++ b/telldus-core/service/ProtocolX10.cpp @@ -116,7 +116,8 @@ std::string ProtocolX10::getStringForMethod(int method, unsigned char data, Cont std::string ProtocolX10::decodeData(const ControllerMessage& dataMsg) { int intData = 0, currentBit = 31; bool method = 0; - sscanf(dataMsg.getParameter("data").c_str(), "%X", &intData); + // TODO(micke): Convert sscanf. This is slow and can overflow buffers! + sscanf(dataMsg.getParameter("data").c_str(), "%X", &intData); // NOLINT(runtime/printf) int unit = 0; int rawHouse = 0;