GLK: AGT: Tidy logic to limit AskQuestion result to 16bit int range

This commit is contained in:
Walter Agazzi 2022-09-24 23:44:56 +02:00 committed by Paul Gilbert
parent 44f8181c24
commit 8ac79a7c7b

View File

@ -94,7 +94,7 @@ static long ask_for_number(int n1, int n2) {
writestr(s);
n = read_number();
if (aver < AGX00)
n = (integer) n;
n = (integer) (n & 0xFFFF);
if (n1 == n2 || (n >= n1 && n <= n2)) return n;
writeln("");
}