ソースを参照

Add assert that shiftcnt remains in bounds on decrement

pull/13/head
Sergey Urbanovich 13年前
コミット
dbbf864bb9
1個のファイルの変更4行の追加2行の削除
  1. +4
    -2
      c_src/encoder.c

+ 4
- 2
c_src/encoder.c ファイルの表示

@ -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, ']');
}

読み込み中…
キャンセル
保存