From 71ef02503ebbd82497920ecc7d580c480865c47a Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sat, 25 Jan 2020 10:55:05 +0100 Subject: Fix URL check in is_autolink In a recent commit, the check was changed to strcmp, but we really have to use strncmp. --- src/commonmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commonmark.c b/src/commonmark.c index cb926c5..497040a 100644 --- a/src/commonmark.c +++ b/src/commonmark.c @@ -143,7 +143,7 @@ static bool is_autolink(cmark_node *node) { return false; } cmark_consolidate_text_nodes(link_text); - if (strcmp((const char *)url, "mailto:") == 0) { + if (strncmp((const char *)url, "mailto:", 7) == 0) { url += 7; } return link_text->data != NULL && -- cgit v1.2.3