name: Converting name to use EncodingBuffer
Change-Id: I7dbc7bdd7198085235cbb0b7108cf4c6d5242a62
diff --git a/src/name-component.hpp b/src/name-component.hpp
index a74c40c..bf7b62c 100644
--- a/src/name-component.hpp
+++ b/src/name-component.hpp
@@ -342,7 +342,8 @@
Component::wireEncode(EncodingImpl<T>& block) const
{
size_t total_len = 0;
- total_len += block.prependByteArray (value(), value_size());
+ if (value_size() > 0)
+ total_len += block.prependByteArray (value(), value_size());
total_len += block.prependVarNumber (value_size());
total_len += block.prependVarNumber (Tlv::NameComponent);
return total_len;