cmark

My personal build of CMark ✏️

Commit
41f1e5aaea98011ce650a59a765549fff5f4468a
Parent
f1665c73196581a26f9aea3028565253a7b5dbac
Author
John MacFarlane <jgm@berkeley.edu>
Date

Coerce realurllen to int.

This is an alternate solution for pull request #132, which introduced a new warning on the comparison:

latex.c:191:20: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'bufsize_t' (aka 'int') [-Wsign-compare] if (realurllen == link_text->as.literal.len && ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~

Diffstat

1 file changed, 2 insertions, 2 deletions

Status File Name N° Changes Insertions Deletions
Modified src/latex.c 4 2 2
diff --git a/src/latex.c b/src/latex.c
@@ -155,7 +155,7 @@ static link_type get_link_type(cmark_node *node) {
   size_t title_len, url_len;
   cmark_node *link_text;
   char *realurl;
-  size_t realurllen;
+  int realurllen;
   bool isemail = false;
 
   if (node->type != CMARK_NODE_LINK) {
@@ -169,7 +169,7 @@ static link_type get_link_type(cmark_node *node) {
     return INTERNAL_LINK;
   }
 
-  url_len = safe_strlen(url);
+  url_len = (int)safe_strlen(url);
   if (url_len == 0 || scan_scheme(&url_chunk, 0) == 0) {
     return NO_LINK;
   }