Crash in MaskUtils.FormatMaskText
Original Reporter info from Mantis: Bart @flyingsheep
-
Reporter name: Bart Broersma
Original Reporter info from Mantis: Bart @flyingsheep
- Reporter name: Bart Broersma
Description:
FormatMaskText('999.999.999.999','555555') gives:
'555.555. . ' (which b.t.w. is wrong, it should be '555. . . ')
FormatMaskText('999.999.999.999;1;_','555555') gives:
TApplication.HandleException FormatMaskText function failed!
Note that in essence the two masks are the same (the 1 for saveliterals and the _ for blankchar are the default ones, if they are not specified in the mask)
Steps to reproduce:
Build and run sample program:
program maskutilsbug;
{$mode objfpc}{$H+}
uses
maskutils;
var
Value, EditMask, Res: String;
begin
Value := '555555';
EditMask := '999.999.999.999';
Res := FormatMaskText(EditMask, Value);
writeln('Res = "',Res,'"');
EditMask := '999.999.999.999;1;_';
Res := FormatMaskText(EditMask, Value);
writeln('Res = "',Res,'"');
end.
Outputs:
C:\Users\Bart\LazarusProjecten\bugs\MaskEdit>maskutilsbug
Res = "555.555. . "
An unhandled exception occurred at $00411AA2 :
Exception : FormatMaskText function failed!<br/>
$00411AA2
$004110C1
$00401673 main, line 16 of maskutilsbug.lpr
Mantis conversion info:
- Mantis ID: 28201
- OS: Window
- OS Build: Win7
- Build: r30929
- Platform: i386
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 34499 (#7d4b3dc7)