summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/LinkLocal/LinkLocalServiceInfo.cpp')
-rw-r--r--Swiften/LinkLocal/LinkLocalServiceInfo.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Swiften/LinkLocal/LinkLocalServiceInfo.cpp b/Swiften/LinkLocal/LinkLocalServiceInfo.cpp
index 516d303..7e18315 100644
--- a/Swiften/LinkLocal/LinkLocalServiceInfo.cpp
+++ b/Swiften/LinkLocal/LinkLocalServiceInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Remko Tronçon
+ * Copyright (c) 2010-2013 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
@@ -7,6 +7,7 @@
#include <Swiften/LinkLocal/LinkLocalServiceInfo.h>
#include <boost/lexical_cast.hpp>
+#include <boost/numeric/conversion/cast.hpp>
#include <Swiften/Base/Algorithm.h>
#include <Swiften/Base/Concat.h>
@@ -49,7 +50,7 @@ ByteArray LinkLocalServiceInfo::toTXTRecord() const {
ByteArray LinkLocalServiceInfo::getEncoded(const std::string& s) {
ByteArray sizeByte;
sizeByte.resize(1);
- sizeByte[0] = s.size();
+ sizeByte[0] = boost::numeric_cast<unsigned char>(s.size());
return concat(sizeByte, createByteArray(s));
}
@@ -109,11 +110,11 @@ std::pair<std::string,std::string> LinkLocalServiceInfo::readEntry(const ByteArr
inKey = false;
}
else {
- key += record[i];
+ key += static_cast<char>(record[i]);
}
}
else {
- value += record[i];
+ value += static_cast<char>(record[i]);
}
++i;
}