xml: Add Value node in TNDS node conversion for empty value case

Previously, the Value node was not added if value of a node could not be
fetched. This can cause interoperability issues, so address that in the
same way as an empty length value, i.e., by adding a Value node with
zero-length contents.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2017-03-26 12:39:34 +03:00 committed by Jouni Malinen
parent a34317b526
commit e2f00bb5ff

View file

@ -246,10 +246,8 @@ static void node_to_tnds(struct xml_node_ctx *ctx, xml_node_t *out,
xml_node_create_text(ctx, tnds, NULL, "Path", uri);
val = get_val(ctx, node);
if (val) {
xml_node_create_text(ctx, tnds, NULL, "Value", val);
xml_node_create_text(ctx, tnds, NULL, "Value", val ? val : "");
xml_node_get_text_free(ctx, val);
}
new_uri = add_path(uri, name);
node_to_tnds(ctx, new_uri ? out : tnds, node, new_uri);