summaryrefslogtreecommitdiff
path: root/src/xml.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-07-25 15:45:33 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-07-25 15:45:33 -0700
commit7bfb3ad4fa39e1461f0579d2fd8aaaab293996e8 (patch)
treec8361f30ad9281c90a23c3be3096015941e93000 /src/xml.c
parent48c87076d442b4c525d7831e7481cea8affa8c5d (diff)
Avoid using strbuf_printf when not needed.
Diffstat (limited to 'src/xml.c')
-rw-r--r--src/xml.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/xml.c b/src/xml.c
index 7eec5a6..815afa5 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -40,8 +40,8 @@ S_render_node(cmark_node *node, cmark_event_type ev_type,
if (entering) {
indent(state);
- cmark_strbuf_printf(xml, "<%s",
- cmark_node_get_type_string(node));
+ cmark_strbuf_putc(xml, '<');
+ cmark_strbuf_puts(xml, cmark_node_get_type_string(node));
if (options & CMARK_OPT_SOURCEPOS && node->start_line != 0) {
cmark_strbuf_printf(xml, " sourcepos=\"%d:%d-%d:%d\"",
@@ -135,8 +135,9 @@ S_render_node(cmark_node *node, cmark_event_type ev_type,
} else if (node->first_child) {
state->indent -= 2;
indent(state);
- cmark_strbuf_printf(xml, "</%s>\n",
- cmark_node_get_type_string(node));
+ cmark_strbuf_puts(xml, "</");
+ cmark_strbuf_puts(xml, cmark_node_get_type_string(node));
+ cmark_strbuf_puts(xml, ">\n");
}
return 1;