From 41ec75629ab19e84dd25a168797afe5fe8c01594 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 11 Aug 2014 19:45:13 +0000 Subject: Tox: some of message sending git-svn-id: http://svn.miranda-ng.org/main/trunk@10158 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_utils.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'protocols/Tox/src/tox_utils.cpp') diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp index 456b1dd75a..b8eed67c68 100644 --- a/protocols/Tox/src/tox_utils.cpp +++ b/protocols/Tox/src/tox_utils.cpp @@ -21,7 +21,7 @@ TOX_USERSTATUS CToxProto::MirandaToToxStatus(int status) return userstatus; } -std::vector HexStringToData(const std::string hex) +std::vector CToxProto::HexStringToData(std::string hex) { std::stringstream ss; std::vector data; @@ -29,16 +29,16 @@ std::vector HexStringToData(const std::string hex) size_t count = hex.length() / 2; for (size_t i = 0; i < count; i++) { - uint8_t temp; - ss << std::hex << hex.substr(i * 2, 2); - ss >> temp; - data.push_back(temp); + unsigned byte; + std::istringstream hex_byte(hex.substr(i * 2, 2)); + hex_byte >> std::hex >> byte; + data.push_back(static_cast(byte)); } return data; } -std::string CToxProto::DataToHexString(const std::vector data) +std::string CToxProto::DataToHexString(std::vector data) { std::stringstream ss; ss << std::hex << std::uppercase; -- cgit v1.2.3