Commit b3a22f38 by Vincent Celier Committed by Arnaud Charlet

a-tifiio.adb (Put, internal): For negative numbers...

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
parent cc9e83af
......@@ -399,7 +399,7 @@ package body Ada.Text_IO.Fixed_IO is
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;
......@@ -462,7 +462,13 @@ package body Ada.Text_IO.Fixed_IO is
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;
---------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment