From 92f986e8d50c6679497736169fdf1d744cc923f9 Mon Sep 17 00:00:00 2001 From: Pawel Andruszkiewicz Date: Thu, 8 Oct 2015 15:32:35 +0200 Subject: [PATCH] [Common] Removed unnecessary TODO. [Verification] Code compiles, logic was not modified. Change-Id: I508b873f2300ef68cbd18e0d57865ff667bb1d39 Signed-off-by: Pawel Andruszkiewicz --- src/common/dbus_operation.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/dbus_operation.cc b/src/common/dbus_operation.cc index 2be83002..c100397f 100755 --- a/src/common/dbus_operation.cc +++ b/src/common/dbus_operation.cc @@ -104,7 +104,8 @@ void DBusOperationArguments::AddArgumentString(const std::string& val) { const int length = val.length(); char* p_val = new char[length+1]; - strncpy(p_val, val.c_str(), length+1); // TODO: is it safe? + // copy 'length' characters and add a NULL-character at 'length+1' position + strncpy(p_val, val.c_str(), length+1); arguments_.push_back(ArgumentElement(ArgType::kTypeString, p_val)); } -- 2.34.1