View Issue Details

IDProjectCategoryView StatusLast Update
0031277FPCFCLpublic2017-01-30 08:37
ReporterJoseph RiethAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Platformlinux 32bitOSlinux 32bitOS Version
Product VersionProduct Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0031277: tRegistry.ReadInteger fails if negative number written
DescriptionThe WriteInteger writes negative number as unsigned integer modulo 2^32 (eg. -1 = 4294967295) into the xlm file. On 32bit linux platform it leads to 'cannot read' error. 64bit linux handles it well.
Steps To Reproducevar Reg : tRegistry; i : Integer;
Reg.WriteInteger('test',-1);
{and later} i:=Reg.ReadInteger('test');
Tags32-bit, linux
Fixed in Revision35344
FPCOldBugId
FPCTarget
Attached Files

Relationships

has duplicate 0031297 resolvedMichael Van Canneyt TXmlRegistry writes numbers as cardinals but reads as signed integers 

Activities

Alexey Tor.

2017-01-26 16:32

reporter   ~0097719

FPC file: xmlreg.pp
change project to FPC.

it has writing of DWORD, but need to add also signed Longint,
and add handling of it
    Case DataType of
      dtDWORD : S:=IntToStr(PCardinal(@Data)^);
      dtString : SetString(S, PAnsiChar(@Data), DataSize);
      dtBinary : S:=BufToHex(Data,DataSize);
    else

here need to add "case" for Longint. Int64 better than Longint.

Zeljan Rikalo

2017-01-26 17:24

reporter   ~0097722

Pls, let someone change project to fpc.

Michael Van Canneyt

2017-01-27 22:48

administrator   ~0097757

I've committed a fix. I cannot test due to no 32-bit linux available, please test and close if OK.

Joseph Rieth

2017-01-29 19:11

reporter   ~0097794

Thanks it was fast!

Issue History

Date Modified Username Field Change
2017-01-26 12:35 Joseph Rieth New Issue
2017-01-26 12:36 Joseph Rieth Tag Attached: 32-bit
2017-01-26 12:36 Joseph Rieth Tag Attached: linux
2017-01-26 16:32 Alexey Tor. Note Added: 0097719
2017-01-26 17:24 Zeljan Rikalo Note Added: 0097722
2017-01-26 18:33 Bart Broersma Project Lazarus => FPC
2017-01-27 22:48 Michael Van Canneyt Fixed in Revision => 35344
2017-01-27 22:48 Michael Van Canneyt Note Added: 0097757
2017-01-27 22:48 Michael Van Canneyt Status new => resolved
2017-01-27 22:48 Michael Van Canneyt Fixed in Version => 3.1.1
2017-01-27 22:48 Michael Van Canneyt Resolution open => fixed
2017-01-27 22:48 Michael Van Canneyt Assigned To => Michael Van Canneyt
2017-01-27 22:48 Michael Van Canneyt Target Version => 3.2.0
2017-01-29 19:11 Joseph Rieth Note Added: 0097794
2017-01-29 19:11 Joseph Rieth Status resolved => closed
2017-01-30 08:37 Michael Van Canneyt Relationship added has duplicate 0031297