2007-04-20 Vincent Celier <celier@adacore.com>
* a-tifiio.adb (Put, internal): For negative numbers, check that there
is room for at least one digit and the minus sign.
(Put.Put_Character): Never put a character outside of the range of
string To.
From-SVN: r125382
Last : Natural;
begin
- if Fore < 1 or else Fore > Field'Last then
+ if Fore - Boolean'Pos (Item < 0.0) < 1 or else Fore > Field'Last then
raise Layout_Error;
end if;
procedure Put_Character (C : Character) is
begin
Last := Last + 1;
- To (Last) := C;
+
+ -- Never put a character outside of string To. Exception Layout_Error
+ -- will be raised later if Last is greater than To'Last.
+
+ if Last <= To'Last then
+ To (Last) := C;
+ end if;
end Put_Character;
---------------