From 289b9af732ad16add8a534ed3daa7db2e4f56e66 Mon Sep 17 00:00:00 2001 From: ryanfleury Date: Fri, 29 Jan 2021 12:09:44 -0700 Subject: [PATCH] adjust error/warning output to match MSVC/Clang/etc. format; fix infinite loop bug in index calculation --- source/md_impl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/md_impl.c b/source/md_impl.c index 18e3fd0..3ff42a1 100644 --- a/source/md_impl.c +++ b/source/md_impl.c @@ -1786,7 +1786,7 @@ MD_IndexFromNode(MD_Node *node) int idx = 0; if(node && !MD_NodeIsNil(node)) { - for(MD_Node *last = node->prev; last; last = last->prev, idx += 1); + for(MD_Node *last = node->prev; !MD_NodeIsNil(last); last = last->prev, idx += 1); } return idx; } @@ -1927,7 +1927,7 @@ MD_NodeMessage(MD_Node *node, MD_MessageKind kind, MD_String8 str) { const char *kind_name = kind == MD_MessageKind_Error ? "error" : "warning"; MD_CodeLoc loc = MD_CodeLocFromNode(node); - fprintf(stderr, "%.*s(%i:%i): %s: %.*s\n", + fprintf(stderr, "%.*s:%i:%i: %s: %.*s\n", MD_StringExpand(loc.filename), loc.line, loc.column, kind_name,