summaryrefslogtreecommitdiff
path: root/examples/dom-structure-dump.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-12-22 11:34:47 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-12-22 11:34:47 +0000
commitaccaa715a750e05c694673b19e2cf280ab9c4f9d (patch)
tree4d452a6a9531170670460c975bd88d2af868f568 /examples/dom-structure-dump.c
parent022a97a640d9ee40da4816e76dbc81bf2a5b0825 (diff)
downloadlibdom-accaa715a750e05c694673b19e2cf280ab9c4f9d.tar.gz
libdom-accaa715a750e05c694673b19e2cf280ab9c4f9d.tar.bz2
Fix length of string prints.
svn path=/trunk/libdom/; revision=13325
Diffstat (limited to 'examples/dom-structure-dump.c')
-rw-r--r--examples/dom-structure-dump.c4
1 files changed, 2 insertions, 2 deletions
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);