encoding: In ndn_decodeBinaryXmlName, use ndn_Name_appendBlob.
diff --git a/src/c/encoding/binary-xml-name.c b/src/c/encoding/binary-xml-name.c
index 30cd60f..8df81c3 100644
--- a/src/c/encoding/binary-xml-name.c
+++ b/src/c/encoding/binary-xml-name.c
@@ -46,12 +46,8 @@
struct ndn_Blob component;
if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Component, 0, &component)))
return error;
-
- // Add the component to the name.
- if (name->nComponents >= name->maxComponents)
- return NDN_ERROR_read_a_component_past_the_maximum_number_of_components_allowed_in_the_name;
- ndn_NameComponent_initialize(name->components + name->nComponents, component.value, component.length);
- ++name->nComponents;
+ if ((error = ndn_Name_appendBlob(name, &component)))
+ return error;
}
if ((error = ndn_BinaryXmlDecoder_readElementClose(decoder)))