aboutsummaryrefslogtreecommitdiff
path: root/rfc4251.C
diff options
context:
space:
mode:
authorTimo Weingärtner <timo@tiwe.de>2015-09-06 18:33:04 +0200
committerTimo Weingärtner <timo@tiwe.de>2015-09-06 18:33:04 +0200
commita11402917796dd21b59c537d3f10c05d3bcefd55 (patch)
tree7a04962ac6f463d42a62ec9d3e18f6d8dae66634 /rfc4251.C
parent602a625ff53118e9052326e5038055aa1d750e23 (diff)
parentc9dfa57b7a06c5b0770e11d210e02ace54518644 (diff)
downloadssh-agent-filter-a11402917796dd21b59c537d3f10c05d3bcefd55.tar.gz
Merge tag '0.4.1' into debian
0.4.1
Diffstat (limited to 'rfc4251.C')
-rw-r--r--rfc4251.C16
1 files changed, 10 insertions, 6 deletions
diff --git a/rfc4251.C b/rfc4251.C
index 8ca5f2b..5ea0a93 100644
--- a/rfc4251.C
+++ b/rfc4251.C
@@ -1,10 +1,10 @@
/*
* rfc4251.C -- support for name-list type from RFC 4251, section 5
*
- * These are the conversions between an rfc4251string containing a name-list
+ * These are the conversions between an rfc4251::string containing a name-list
* and vector<string>.
*
- * Copyright (C) 2013 Timo Weingärtner <timo@tiwe.de>
+ * Copyright (C) 2013,2015 Timo Weingärtner <timo@tiwe.de>
*
* This file is part of ssh-agent-filter.
*
@@ -22,14 +22,16 @@
* along with ssh-agent-filter. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "rfc4251.h"
+#include "rfc4251.H"
-rfc4251string::rfc4251string (std::vector<std::string> const & v) {
+namespace rfc4251 {
+
+string::string (std::vector<std::string> const & v) {
for (auto it = v.begin(); it != v.end();) {
if (it->size() == 0)
throw std::length_error{"name of zero length"};
if (value.size() + it->size() > std::numeric_limits<uint32_t>::max())
- throw std::length_error{"32-bit limit for rfc4251string exceeded"};
+ throw std::length_error{"32-bit limit for rfc4251::string exceeded"};
value.insert(value.end(), it->data(), it->data() + it->size());
++it;
if (it == v.end())
@@ -38,7 +40,7 @@ rfc4251string::rfc4251string (std::vector<std::string> const & v) {
}
}
-rfc4251string::operator std::vector<std::string> () const {
+string::operator std::vector<std::string> () const {
std::vector<std::string> ret;
auto name_start = value.begin();
if (name_start != value.end())
@@ -54,3 +56,5 @@ rfc4251string::operator std::vector<std::string> () const {
}
return ret;
}
+
+}