From 2842ecf5fb22161eb1eaf29ca1336c709ab0ac73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20L=C3=A4ufer?= Date: Thu, 14 Nov 2024 15:13:23 -0500 Subject: [PATCH] fix one off by one bug --- wellen/src/vcd.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wellen/src/vcd.rs b/wellen/src/vcd.rs index 6836384..49725a5 100644 --- a/wellen/src/vcd.rs +++ b/wellen/src/vcd.rs @@ -1213,7 +1213,9 @@ fn parse_body( state = match parse_first_token(&first)? { FirstTokenResult::Time(value) => { // check to see if this time value is already past the stop position - if pos > stop_pos { + // we subtract one to account for the fact that the current + // character is a whitespace and thus not part of the time command + if pos - 1 > stop_pos { // exit progress_report.report(pos, true); return Ok(());