File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -57,14 +57,14 @@ atob = (s) ->
57
57
i = 0
58
58
if s .length > 1 and s[i] == ' 0'
59
59
if s[i+ 1 ] == ' x' or s[i+ 1 ] == ' X'
60
- i += 2
60
+ i += 2
61
61
base = 16
62
- else if ' 0' <= s[i+ 1 ] and s[i+ 1 ] <= ' 7 '
62
+ else if ' 0' <= s[i+ 1 ] and s[i+ 1 ] <= ' 9 '
63
63
i++
64
64
base = 8
65
65
dmax = ' 7'
66
66
start = i
67
- while s .length > 0
67
+ while i < s .length
68
68
if ' 0' <= s[i] and s[i] <= dmax
69
69
n = (n* base + (chr (s[i])- chr0)) >>> 0
70
70
else if base == 16
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ vows.describe('Invalid IP format')
42
42
' 1.2.3.4 ' : shouldFailWithError ' Invalid net'
43
43
' 1 .2.3.4' : shouldFailWithError ' Invalid net'
44
44
' 018.0.0.0' : shouldFailWithError ' Invalid net'
45
+ ' 08.0.0.0' : shouldFailWithError ' Invalid net'
45
46
' 0xfg.0.0.0' : shouldFailWithError ' Invalid net'
46
47
.export (module )
47
48
You can’t perform that action at this time.
0 commit comments