From f4ceb7833993573189dc71cd9662ab01312c6185 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 22 Dec 2011 11:34:47 +0000 Subject: Fix length of string prints. svn path=/trunk/libdom/; revision=13325 --- examples/dom-structure-dump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/dom-structure-dump.c b/examples/dom-structure-dump.c index f950fb6..3c073e4 100644 --- a/examples/dom-structure-dump.c +++ b/examples/dom-structure-dump.c @@ -177,7 +177,7 @@ bool dump_dom_element_attribute(dom_node_internal *node, char *attribute) length = dom_string_byte_length(attr_value); /* Print attribute info */ - printf(" %s=\"%*s\"", attribute, (int)length, string); + printf(" %s=\"%.*s\"", attribute, (int)length, string); /* Finished with the attr_value dom_string */ dom_string_unref(attr_value); @@ -233,7 +233,7 @@ bool dump_dom_element(dom_node_internal *node, int depth) /* Get string data and print element name */ string = dom_string_data(node_name); length = dom_string_byte_length(node_name); - printf("%*s", (int)length, string); + printf("%.*s", (int)length, string); /* Finished with the node_name dom_string */ dom_string_unref(node_name); -- cgit v1.2.3