View Issue Details

IDProjectCategoryView StatusLast Update
0037061FPCPackagespublic2020-05-13 13:41
ReporterBart Broersma Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Platformi386OSWindows 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0037061: function HostAddrToStr6 in sockets.inc: don't compare a boolean variable to True
DescriptionRelated to 0037013

There is no need to compare a boolean variable to True (nor to False for that matter).
Attached patch replaces 2 occurrences of such "if BooleanVar = True" with a simple "if BooleanVar"
No functional changes.
Just a little tweak in the coding style.

Feel free to dismiss.
TagsNo tags attached.
Fixed in Revision45355
FPCOldBugId
FPCTarget4.0.0
Attached Files

Relationships

related to 0037013 resolvedMichael Van Canneyt StrToHostAddr6 in sockets unit parses invalid IPv6 addresses 

Activities

Bart Broersma

2020-05-13 11:40

reporter  

sockets.inc.diff (930 bytes)   
Index: packages/rtl-extra/src/inc/sockets.inc
===================================================================
--- packages/rtl-extra/src/inc/sockets.inc	(revision 45354)
+++ packages/rtl-extra/src/inc/sockets.inc	(working copy)
@@ -597,7 +597,7 @@
           begin
             // if we saw a collapsed sequence before, or if we've already
             // seen 8 hextets.
-            if (coll_zero_seen = True) or (hextet_idx > 7) then exit;
+            if coll_zero_seen or (hextet_idx > 7) then exit;
             coll_zero_seen := True;
             coll_start_idx := hextet_idx;
             Inc(hextet_idx);
@@ -670,7 +670,7 @@
 
   // finish line is in sight. if we have a collapsed-zeroes sequence
   // then we must fill that in now.
-  if coll_zero_seen = True then
+  if coll_zero_seen then
   begin
     for tmpByte := 0 to coll_start_idx do
       StrToHostAddr6.s6_addr16[tmpByte] := hextet_arr[tmpByte];
sockets.inc.diff (930 bytes)   

Michael Van Canneyt

2020-05-13 12:10

administrator   ~0122760

Applied, thank you !

Issue History

Date Modified Username Field Change
2020-05-13 11:40 Bart Broersma New Issue
2020-05-13 11:40 Bart Broersma File Added: sockets.inc.diff
2020-05-13 12:08 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-05-13 12:08 Michael Van Canneyt Status new => assigned
2020-05-13 12:10 Michael Van Canneyt Status assigned => resolved
2020-05-13 12:10 Michael Van Canneyt Resolution open => fixed
2020-05-13 12:10 Michael Van Canneyt Fixed in Version => 3.3.1
2020-05-13 12:10 Michael Van Canneyt Fixed in Revision => 45355
2020-05-13 12:10 Michael Van Canneyt FPCTarget => 4.0.0
2020-05-13 12:10 Michael Van Canneyt Note Added: 0122760
2020-05-13 12:11 Michael Van Canneyt Relationship added related to 0037013
2020-05-13 13:41 Bart Broersma Status resolved => closed