aboutsummaryrefslogtreecommitdiffstats
path: root/src/types
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-07-03 16:47:20 +0200
committerbptato <nincsnevem662@gmail.com>2023-07-03 16:59:39 +0200
commit519e5fa0986320d55ddcc5c0fa2b8e44dbff779b (patch)
tree43dfbc2c03c3283185688710bad1518ffe136a01 /src/types
parentd86abdbfcf081d6a91d0cfc37c5c854527b7b551 (diff)
downloadchawan-519e5fa0986320d55ddcc5c0fa2b8e44dbff779b.tar.gz
Fix CastSize warnings
Introduced by 1.6.14. Warns of undefined behavior.
Diffstat (limited to 'src/types')
-rw-r--r--src/types/url.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/types/url.nim b/src/types/url.nim
index b8b4913a..727d7b84 100644
--- a/src/types/url.nim
+++ b/src/types/url.nim
@@ -798,7 +798,11 @@ func serializeip(ipv6: array[8, uint16]): string =
result &= ':'
ignore0 = true
continue
- result &= toHex(ipv6[i])
+ const HexChars = "0123456789abcdef"
+ var x = ipv6[i]
+ while x != 0:
+ result &= HexChars[x mod 0x10]
+ x = x div 0x10
if i != high(ipv6):
result &= ':'