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,4 +1,4 @@
/*
- * 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.
@@ -8,4 +8,5 @@
#include <boost/lexical_cast.hpp>
+#include <boost/numeric/conversion/cast.hpp>
#include <Swiften/Base/Algorithm.h>
@@ -50,5 +51,5 @@ 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));
}
@@ -110,9 +111,9 @@ std::pair<std::string,std::string> LinkLocalServiceInfo::readEntry(const ByteArr
}
else {
- key += record[i];
+ key += static_cast<char>(record[i]);
}
}
else {
- value += record[i];
+ value += static_cast<char>(record[i]);
}
++i;