From aeda9f0cacd191144cd1bde4c9b65d8e8eadfd8f Mon Sep 17 00:00:00 2001 From: Stefan Droege Date: Thu, 5 Sep 2019 14:08:55 +0200 Subject: [PATCH] Fix one bit signals value extraction `line.substring(0,0)` results in a zero-length string. As the documentation for `String::substring` says: "The substring begins at the specified beginIndex and extends to the character at index endIndex - 1.". So to extract the first character, `startindex` must be `0` `endindex` must be `1`. --- vcd/VCD.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcd/VCD.java b/vcd/VCD.java index 157f98c..408586c 100644 --- a/vcd/VCD.java +++ b/vcd/VCD.java @@ -455,7 +455,7 @@ public void collectTimes()throws IOException // One bit signals have no space between value and symbol else if(parts.length == 1) { - currentTimePoint.addPair(new SigVal(line.substring(1), line.substring(0,0))); + currentTimePoint.addPair(new SigVal(line.substring(1), line.substring(0,1))); } else if(parts.length == 2) {