From 1a70a39f9d23a2b4ef29e6c39034eb408ddff273 Mon Sep 17 00:00:00 2001 From: dx Date: Wed, 20 May 2020 15:41:00 +0100 Subject: +test case for an empty tag --- Converter/src/compiler.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Converter') diff --git a/Converter/src/compiler.c b/Converter/src/compiler.c index 2fb5607..e2dd74b 100644 --- a/Converter/src/compiler.c +++ b/Converter/src/compiler.c @@ -95,6 +95,11 @@ void compile_inner_text(string dest, string src, size_t sz_src, break; } + if (src[i + md_tag_size] == '\0') + { + strncpy(dest, src + i, md_tag_size); + break; + } // find the corresponding markdown tag, and report errors j = find_string(src + i + md_tag_size, md_tag, sz_src - i - md_tag_size, md_tag_size); -- cgit v1.2.3-13-gbd6f