Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/RTL/Delphi/Format + Float    [ Add a report in this area ]  
Report #:  63633   Status: Closed
FormatBcd causes AV when TBcd is 0
Project:  Delphi Build #:  11.0.2902.10471
Version:    11.2 Submitted By:   Tomohiro Takahashi
Report Type:  Crash / Data loss / Total failure Date Reported:  6/23/2008 7:49:12 PM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   261296
Resolution: Cannot Reproduce (Resolution Comments) Resolved in Build: : 2010, XE
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 2
Description
FormatBcd causes AV when second parameter is 0.
The parameter is generated by IntegerToBcd(0);
Steps to Reproduce:
1. execute this code.
----
procedure TForm1.Button1Click(Sender: TObject);
var
  fbcd: TBcd;
begin
  fbcd := IntegerToBcd(0);
  FormatBcd('#,###', fbcd);
end;
----

2. FormatBcd causes AV
Workarounds
none
Attachment
None
Comments

maziar navahan at 6/25/2008 3:30:37 AM -
i trace in delphi source code FMTBcd.pas

problem seem in RoundAt(const Value: string; Position: SmallInt)

when Value is null in line 631 when
<if Value[1] = '-' then>
seems this code must protect from null input value

Server Response from: ETNACODE01