Added writeOptionalBlobDTagElement
diff --git a/ndn-cpp/c/encoding/BinaryXMLInterest.c b/ndn-cpp/c/encoding/BinaryXMLInterest.c
index 6b02176..9b06a76 100644
--- a/ndn-cpp/c/encoding/BinaryXMLInterest.c
+++ b/ndn-cpp/c/encoding/BinaryXMLInterest.c
@@ -175,11 +175,9 @@
return error;
}
- if (interest->nonce && interest->nonceLength > 0) {
- if (error = ndn_BinaryXMLEncoder_writeBlobDTagElement
- (encoder, ndn_BinaryXML_DTag_Nonce, interest->nonce, interest->nonceLength))
- return error;
- }
+ if (error = ndn_BinaryXMLEncoder_writeOptionalBlobDTagElement
+ (encoder, ndn_BinaryXML_DTag_Nonce, interest->nonce, interest->nonceLength))
+ return error;
if (error = ndn_BinaryXMLEncoder_writeElementClose(encoder))
return error;