… | |
… | |
125 | } JSON; |
125 | } JSON; |
126 | |
126 | |
127 | INLINE void |
127 | INLINE void |
128 | json_init (JSON *json) |
128 | json_init (JSON *json) |
129 | { |
129 | { |
130 | Zero (json, 1, JSON); |
130 | static const JSON init = { F_ALLOW_NONREF, 512 }; |
131 | json->max_depth = 512; |
131 | |
|
|
132 | *json = init; |
132 | } |
133 | } |
133 | |
134 | |
134 | ///////////////////////////////////////////////////////////////////////////// |
135 | ///////////////////////////////////////////////////////////////////////////// |
135 | // utility functions |
136 | // utility functions |
136 | |
137 | |
… | |
… | |
1794 | else if (sv) |
1795 | else if (sv) |
1795 | { |
1796 | { |
1796 | // check for trailing garbage |
1797 | // check for trailing garbage |
1797 | decode_ws (&dec); |
1798 | decode_ws (&dec); |
1798 | |
1799 | |
1799 | if (*dec.cur) |
1800 | if (dec.cur != dec.end) |
1800 | { |
1801 | { |
1801 | dec.err = "garbage after JSON object"; |
1802 | dec.err = "garbage after JSON object"; |
1802 | SvREFCNT_dec (sv); |
1803 | SvREFCNT_dec (sv); |
1803 | sv = 0; |
1804 | sv = 0; |
1804 | } |
1805 | } |