diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-01-18 09:26:14 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-01-18 09:26:14 -0800 |
commit | 7e1f8b8e49ca291a7757c55a8e02fc7a85d1434c (patch) | |
tree | 1c777b0fd81cb44d2dc50a95c915491b04bf6670 /src/latex.c | |
parent | ac812214f6fa81b201b8fcf3779ed8d2c3cfacf7 (diff) | |
parent | 0b5a8193fdc7b041023e44149a1d63b95ce98bfd (diff) |
Merge branch 'master' of https://github.com/mbenelli/cmark into mbenelli-master
Diffstat (limited to 'src/latex.c')
-rw-r--r-- | src/latex.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/latex.c b/src/latex.c index 57d474c..879f813 100644 --- a/src/latex.c +++ b/src/latex.c @@ -217,7 +217,8 @@ static int S_get_enumlevel(cmark_node *node) { static int S_render_node(cmark_renderer *renderer, cmark_node *node, cmark_event_type ev_type, int options) { int list_number; - char list_number_string[20]; + const size_t LIST_NUMBER_STRING_SIZE = 20; + char list_number_string[LIST_NUMBER_STRING_SIZE]; bool entering = (ev_type == CMARK_EVENT_ENTER); cmark_list_type list_type; const char *roman_numerals[] = {"", "i", "ii", "iii", "iv", "v", @@ -249,7 +250,8 @@ static int S_render_node(cmark_renderer *renderer, cmark_node *node, CR(); list_number = cmark_node_get_list_start(node); if (list_number > 1) { - sprintf(list_number_string, "%d", list_number); + snprintf(list_number_string, LIST_NUMBER_STRING_SIZE, "%d", + list_number); LIT("\\setcounter{enum"); LIT((char *)roman_numerals[S_get_enumlevel(node)]); LIT("}{"); |