summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-07-06 09:24:07 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-07-06 09:24:07 -0700
commit6aebde8f56e3f62cab95c601b9d608da4a9e2dc2 (patch)
tree4d745a416ca1eda9a3184f44cdcf194f44b3bda3
parent09e312abd6dca9e2e55050d3d4eacfd52fea8d73 (diff)
Use sprintf rather than snprintf because we know it won't overflow.
A rendered int can't be 20 digits.
-rw-r--r--src/latex.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/latex.c b/src/latex.c
index 0148ec3..5a249e5 100644
--- a/src/latex.c
+++ b/src/latex.c
@@ -409,14 +409,8 @@ S_render_node(cmark_node *node, cmark_event_type ev_type,
cr(state);
list_number = cmark_node_get_list_start(node);
if (list_number > 1) {
-#ifdef HAVE_C99_SNPRINTF
- len = snprintf(list_number_string, 19,
+ len = sprintf(list_number_string,
"%d", list_number);
-#else
- // Assume we're on Windows.
- len = _snprintf("%d", 19,
- "%d", list_number);
-#endif
lit(state, "\\setcounter{enum", false);
lit(state, (char *)roman_numerals[state->enumlevel],
false);