I just picked up Ada a few minutes ago, so forgive me if this seems like a trivial question.
There is a loop in my program that causes an end error if the input ends with a " " character. My program works for correct input but I'm trying to catch some edge cases.
> echo "1 2 3 " | ./eofloop3a
raised ADA.IO_EXCEPTIONS.END_ERROR : a-textio.adb:506
The loop in question
procedure fun1 is
F : Integer;
begin
while (not End_Of_File) loop
Get(F);
end loop;
end fun1;
Why is this happening and is there a way to prevent reading out of bounds? I was thinking the while condition should've prevented this from happening.