From 48fba00eb428fcb58c19a2b336089e3d4101f1ac Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 5 Mar 2020 09:54:14 +0100 Subject: [PATCH] Fix a compil warning. Fixes #3964 https://gitlab.com/kicad/code/kicad/issues/3964 --- thirdparty/markdown2html/md_parser/autolink.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/thirdparty/markdown2html/md_parser/autolink.c b/thirdparty/markdown2html/md_parser/autolink.c index b57c55ad99..be87440911 100644 --- a/thirdparty/markdown2html/md_parser/autolink.c +++ b/thirdparty/markdown2html/md_parser/autolink.c @@ -216,10 +216,11 @@ size_t sd_autolink__www( size_t* rewind_p, struct buf* link, uint8_t* data, size_t sd_autolink__email( size_t* rewind_p, struct buf* link, uint8_t* data, size_t max_rewind, size_t size, unsigned int flags ) { - size_t link_end, rewind; + size_t link_end; + int rewind; int nb = 0, np = 0; - for( rewind = 0; rewind < max_rewind; ++rewind ) + for( rewind = 0; rewind < (int)max_rewind; ++rewind ) { uint8_t c = data[-rewind - 1]; @@ -269,12 +270,14 @@ size_t sd_autolink__email( size_t* rewind_p, struct buf* link, uint8_t* data, size_t sd_autolink__url( size_t* rewind_p, struct buf* link, uint8_t* data, size_t max_rewind, size_t size, unsigned int flags ) { - size_t link_end, rewind = 0, domain_len; + size_t link_end, domain_len; if( size < 4 || data[1] != '/' || data[2] != '/' ) return 0; - while( rewind < max_rewind && isalpha( data[-rewind - 1] ) ) + int rewind = 0; + + while( rewind < (int)max_rewind && isalpha( data[-rewind - 1] ) ) rewind++; if( !sd_autolink_issafe( data - rewind, size + rewind ) )