From 0791433a4e76bbeaa66a122a6f4d3ea04bd22621 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Sat, 20 Apr 2013 10:30:22 +0200 Subject: [PATCH] envelope: correctly return parsed envelope type --- src/envelope.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/envelope.cpp b/src/envelope.cpp index 1bb9e16..bedcd4b 100644 --- a/src/envelope.cpp +++ b/src/envelope.cpp @@ -33,6 +33,7 @@ inline static bool acceptable_char (char c) static bool acceptable_id (const std::string&a) { + if (!a.length() ) return false; for (size_t i = 0; i < a.length(); ++i) if (!acceptable_char (a[i]) ) return false; return true; @@ -152,7 +153,8 @@ size_t envelope_read (const std::string&data, size_t offset, if (retry) continue; - //return the modified offset + //return type and modified offset + out_type = type; return offset; } }