aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc/parse-error.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds-kbdc/parse-error.c')
-rw-r--r--src/mds-kbdc/parse-error.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mds-kbdc/parse-error.c b/src/mds-kbdc/parse-error.c
index 298c712..dfaf116 100644
--- a/src/mds-kbdc/parse-error.c
+++ b/src/mds-kbdc/parse-error.c
@@ -73,7 +73,8 @@ void mds_kbdc_parse_error_print(const mds_kbdc_parse_error_t* restrict this, FIL
/* Convert bytes count to character count for the code position */
for (i = 0, n = this->start; i < n; i++)
- start++;
+ if ((code[i] & 0xC0) != 0x80)
+ start++;
for (n = this->end; i < n; i++)
if ((code[i] & 0xC0) != 0x80)
end++;