Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
tarvlad committed Mar 5, 2023
1 parent 473668d commit cf34d60
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/rars/util/SystemIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,12 @@ public static String readString(int serviceNumber, int maxLength) {
public static int readChar(int serviceNumber) {
int returnValue = 0;

String input = readStringInternal("0", "Enter a character value (syscall " + serviceNumber + ")", -1);
String input;
if (Globals.getGui() == null) {
input = readStringInternal("0", "Enter a character value (syscall " + serviceNumber + ")", -1);
} else {
input = readStringInternal("0", "Enter a character value (syscall " + serviceNumber + ")", 1);
}
// The whole try-catch is not really necessary in this case since I'm
// just propagating the runtime exception (the default behavior), but
// I want to make it explicit. The client needs to catch it.
Expand Down

0 comments on commit cf34d60

Please sign in to comment.