Change the ExcludeEntry to use a name component directly.
diff --git a/ndn-cpp/c/encoding/binary-xml-interest.c b/ndn-cpp/c/encoding/binary-xml-interest.c
index a540222..b835ebd 100644
--- a/ndn-cpp/c/encoding/binary-xml-interest.c
+++ b/ndn-cpp/c/encoding/binary-xml-interest.c
@@ -26,7 +26,7 @@
if (entry->type == ndn_Exclude_COMPONENT) {
if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
- (encoder, ndn_BinaryXml_DTag_Component, entry->component, entry->componentLength)))
+ (encoder, ndn_BinaryXml_DTag_Component, entry->component.value, entry->component.valueLength)))
return error;
}
else if (entry->type == ndn_Exclude_ANY) {
diff --git a/ndn-cpp/c/interest.h b/ndn-cpp/c/interest.h
index bdb28b1..c3a1647 100644
--- a/ndn-cpp/c/interest.h
+++ b/ndn-cpp/c/interest.h
@@ -23,8 +23,7 @@
*/
struct ndn_ExcludeEntry {
ndn_ExcludeType type;
- unsigned char *component; /**< pointer to the pre-allocated buffer for the component value */
- unsigned int componentLength; /**< the number of bytes in value */
+ struct ndn_NameComponent component;
};
/**
@@ -37,8 +36,7 @@
static inline void ndn_ExcludeEntry_init(struct ndn_ExcludeEntry *self, ndn_ExcludeType type, unsigned char *component, unsigned int componentLength)
{
self->type = type;
- self->component = component;
- self->componentLength = componentLength;
+ ndn_NameComponent_init(&self->component, component, componentLength);
}
/**