summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorrockcavera <rockcavera@gmail.com>2020-10-25 04:29:57 -0300
committerGitHub <noreply@github.com>2020-10-25 08:29:57 +0100
commit7252a50fefb844d97ad4630c1db00063380ff3c4 (patch)
tree4cf75ef75761870d26300dbe43f524d948ce3387 /lib/pure
parent64eb62889a3c95986074b3e0d5656d7ad42ab826 (diff)
downloadNim-7252a50fefb844d97ad4630c1db00063380ff3c4.tar.gz
fix #15698 (#15699)
* fix in the net.`$` to print zeros that are not in the compressed group

* Update lib/pure/net.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>

* Update net.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/net.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pure/net.nim b/lib/pure/net.nim
index 3ef41aa3c..cd509463a 100644
--- a/lib/pure/net.nim
+++ b/lib/pure/net.nim
@@ -1827,6 +1827,10 @@ proc `$`*(address: IpAddress): string =
                 result.add(chr(uint16(ord('a'))+val-0xA))
               afterLeadingZeros = true
             mask = mask shr 4
+
+          if not afterLeadingZeros:
+            result.add '0'
+
           printedLastGroup = true
 
 proc dial*(address: string, port: Port,