This repository was archived by the owner on May 22, 2023. It is now read-only.
File tree 1 file changed +14
-5
lines changed
1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 32
32
33
33
procedure Parse (Data : String)
34
34
is
35
- Last : Positive := Data'Last ;
35
+ Last : Positive;
36
36
begin
37
+ if Data'Last not in Positive'Range then
38
+ return ;
39
+ end if ;
40
+ Last := Data'Last;
37
41
if not Componolit.Interfaces.Log.Initialized (Log) and then Data'Length > 1 then
38
42
for I in Data'Range loop
39
- if Data (I) = ASCII.LF then
43
+ if Data (I) = ASCII.LF and I > 1 then
40
44
Last := I - 1 ;
41
45
exit ;
42
46
end if ;
43
47
end loop ;
44
48
Componolit.Interfaces.Log.Client.Initialize (Log, C, Data (Data'First .. Last));
45
49
if Componolit.Interfaces.Log.Initialized (Log) then
46
- Componolit.Interfaces.Log.Client.Info (Log, " Log session configured with label: "
47
- & Data (Data'First .. Last));
50
+ if Last - Data'First > Componolit.Interfaces.Log.Maximum_Message_Length (Log) then
51
+ Last := Data'First + Componolit.Interfaces.Log.Maximum_Message_Length (Log) - 1 ;
52
+ end if ;
53
+ Componolit.Interfaces.Log.Client.Info (Log, " Log session configured with label: " );
54
+ Componolit.Interfaces.Log.Client.Info (Log, Data (Data'First .. Last - 1 ));
48
55
else
49
56
Main.Vacate (C, Main.Failure);
50
57
end if ;
51
- else
58
+ elsif Componolit.Interfaces.Log.Initialized (Log) then
52
59
Componolit.Interfaces.Log.Client.Info (Log, " Rom changed, exiting..." );
53
60
Main.Vacate (C, Main.Success);
61
+ else
62
+ Main.Vacate (C, Main.Failure);
54
63
end if ;
55
64
end Parse ;
56
65
You can’t perform that action at this time.
0 commit comments