Browse Source

Add assert that shiftcnt remains in bounds on decrement

pull/13/head
Sergey Urbanovich 13 years ago
parent
commit
dbbf864bb9
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      c_src/encoder.c

+ 4
- 2
c_src/encoder.c View File

@ -430,7 +430,8 @@ enc_start_object(Encoder* e)
static inline int
enc_end_object(Encoder* e)
{
e->shiftcnt--;
if (!e->shiftcnt--)
return 0;
return MAYBE_PRETTY_INDENT(e) && enc_char(e, '}');
}
@ -445,7 +446,8 @@ enc_start_array(Encoder* e)
static inline int
enc_end_array(Encoder* e)
{
e->shiftcnt--;
if (!e->shiftcnt--)
return 0;
return MAYBE_PRETTY_INDENT(e) && enc_char(e, ']');
}

Loading…
Cancel
Save