about summary refs log tree commit diff stats
path: root/src/types
diff options
context:
space:
mode:
Diffstat (limited to 'src/types')
-rw-r--r--src/types/cookie.nim10
-rw-r--r--src/types/url.nim2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/types/cookie.nim b/src/types/cookie.nim
index 486c6789..93d3757f 100644
--- a/src/types/cookie.nim
+++ b/src/types/cookie.nim
@@ -33,10 +33,10 @@ proc parseCookieDate(val: string): Option[DateTime] =
   var foundMonth = false
   var foundYear = false
   # date-token-list
-  var time: array[3, int]
-  var dayOfMonth: int
-  var month: int
-  var year: int
+  var time = array[3, int].default
+  var dayOfMonth = 0
+  var month = 0
+  var year = 0
   for dateToken in val.split(Delimiters):
     if dateToken == "": continue # *delimiter
     if not foundTime:
@@ -47,7 +47,7 @@ proc parseCookieDate(val: string): Option[DateTime] =
           if i > 2: break timeBlock # too many time fields
           # 1*2DIGIT
           if timeField.len != 1 and timeField.len != 2: break timeBlock
-          var timeFields: array[3, int]
+          var timeFields = array[3, int].default
           for c in timeField:
             if c notin AsciiDigit: break timeBlock
             timeFields[i] *= 10
diff --git a/src/types/url.nim b/src/types/url.nim
index 80df920d..cca36eea 100644
--- a/src/types/url.nim
+++ b/src/types/url.nim
@@ -108,7 +108,7 @@ func parseIpv6(input: openArray[char]): Option[array[8, uint16]] =
   var pieceindex = 0
   var compress = -1
   var pointer = 0
-  var address: array[8, uint16]
+  var address = array[8, uint16].default
 
   template c(i = 0): char = input[pointer + i]
   template has(i = 0): bool = (pointer + i < input.len)