Skip to content

Commit

Permalink
Corrected bug where tokenizer cursor could go out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
NoaSenesi committed Oct 31, 2023
1 parent dc1cbdb commit 9b4c797
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mkpkg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ echo "#!/bin/sh" >> package/usr/local/bin/g2t
echo java -jar /usr/local/bin/g2t.jar \$@ >> package/usr/local/bin/g2t

echo Package: g2t >> package/DEBIAN/control
echo Version: 3.0.2 >> package/DEBIAN/control
echo Version: 3.0.3 >> package/DEBIAN/control
echo Maintainer: Noa Senesi >> package/DEBIAN/control
echo Architecture: all >> package/DEBIAN/control
echo Description: Grammar2Table >> package/DEBIAN/control
Expand Down
2 changes: 1 addition & 1 deletion src/fr/senesi/g2t/Grammar2Table.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import fr.senesi.g2t.tokenizer.Tokenizer;

public class Grammar2Table {
public static final String VERSION = "3.0.2";
public static final String VERSION = "3.0.3";

public static void main(String[] args) {
if (args.length == 0) {
Expand Down
2 changes: 2 additions & 0 deletions src/fr/senesi/g2t/tokenizer/Tokenizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ private void tokenize() throws TokenizationException {
}
}

if (cursor >= stream.length()) break;

c = stream.charAt(cursor);

if (c == '\n') {
Expand Down

0 comments on commit 9b4c797

Please sign in to comment.