Skip to content

Commit 4bf57ea

Browse files
committed
Swapped calloc argument order, so that we use the function appropriately.
1 parent 5790bf2 commit 4bf57ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/commonmark.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ static int S_render_node(cmark_renderer *renderer, cmark_node *node,
478478
if (entering) {
479479
LIT("[^");
480480

481-
char *footnote_label = renderer->mem->calloc(1, (sizeof(char) * node->parent_footnote_def->as.literal.len) + 1);
481+
char *footnote_label = renderer->mem->calloc(node->parent_footnote_def->as.literal.len + 1, sizeof(char));
482482
memmove(footnote_label, node->parent_footnote_def->as.literal.data, node->parent_footnote_def->as.literal.len);
483483

484484
OUT(footnote_label, false, LITERAL);
@@ -493,7 +493,7 @@ static int S_render_node(cmark_renderer *renderer, cmark_node *node,
493493
renderer->footnote_ix += 1;
494494
LIT("[^");
495495

496-
char *footnote_label = renderer->mem->calloc(1, (sizeof(char) * node->as.literal.len) + 1);
496+
char *footnote_label = renderer->mem->calloc(node->as.literal.len + 1, sizeof(char));
497497
memmove(footnote_label, node->as.literal.data, node->as.literal.len);
498498

499499
OUT(footnote_label, false, LITERAL);

0 commit comments

Comments
 (0)