Skip to content

Commit 3f521da

Browse files
committed
decoder max_depth below 1 should default to max
1 parent 9fc8848 commit 3f521da

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

hjson-lua-0.2.0-1.rockspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package = "hjson-lua"
2-
version = "0.2.0-1"
2+
version = "0.3.0-1"
33
source = {
44
url = "git://github.com/hjson/hjson-lua.git",
55
}

hjson/decoder.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function HjsonDecoder:new(options)
8383
if type(options.strict) ~= "boolean" then
8484
options.strict = true
8585
end
86-
if type(options.max_depth) ~= "number" then
86+
if type(options.max_depth) ~= "number" or options.max_depth < 1 then
8787
options.max_depth = DEFAULT_MAX_DEPTH
8888
end
8989

0 commit comments

Comments
 (0)