From: Matthias Kruk Date: Sat, 30 May 2020 14:15:06 +0000 (+0900) Subject: tokenize: Fix off-by-one bug in the column number X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=47da0c66fb9e8403c09e70792fd406a1476cfaab;p=ccc tokenize: Fix off-by-one bug in the column number --- diff --git a/src/tokenize.c b/src/tokenize.c index 9790f6d..dcfcfe6 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -45,7 +45,7 @@ static char _next = 0; static int _state = STATE_NONE; static int _line = 1; -static int _col = 1; +static int _col = 0; static int _pline = 1; static int _pcol = 1; list_t *tokens = NULL; @@ -70,7 +70,7 @@ int getnext(void) _pline = _line; _pcol = _col; _line++; - _col = 1; + _col = 0; break; case '\t':