diff options
author | Patrick McHardy <kaber@trash.net> | 2014-01-10 09:28:37 +0000 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2014-01-10 09:28:37 +0000 |
commit | 806f8bba0a611fc0ce5b3104b929ce441f2b6f77 (patch) | |
tree | 17d698563a70e64aed7db704645c953e795eaf3d /src/erec.c | |
parent | 842e591e8fbec20578d11e407e9d327f2e974276 (diff) |
erec: fix error markup for errors starting at column 0
For errors starting at column 0, we must not subtract 1 to avoid underflow.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/erec.c')
-rw-r--r-- | src/erec.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -138,7 +138,8 @@ void erec_print(FILE *f, const struct error_record *erec) end = 0; for (l = erec->num_locations - 1; l >= 0; l--) { loc = &erec->locations[l]; - for (i = loc->first_column - 1; i < loc->last_column; i++) + for (i = loc->first_column ? loc->first_column - 1 : 0; + i < loc->last_column; i++) buf[i] = l ? '~' : '^'; end = max(end, loc->last_column); } |