diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2011-12-22 11:34:47 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2011-12-22 11:34:47 +0000 |
commit | f4ceb7833993573189dc71cd9662ab01312c6185 (patch) | |
tree | 4d452a6a9531170670460c975bd88d2af868f568 /examples | |
parent | b14bd391bf5719359b6f30acbbced68969efaf78 (diff) | |
download | libdom-f4ceb7833993573189dc71cd9662ab01312c6185.tar.gz libdom-f4ceb7833993573189dc71cd9662ab01312c6185.tar.bz2 |
Fix length of string prints.
svn path=/trunk/libdom/; revision=13325
Diffstat (limited to 'examples')
-rw-r--r-- | examples/dom-structure-dump.c | 4 |
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); |