Kaynağa Gözat

Add assert that shiftcnt remains in bounds on decrement

pull/13/head
Sergey Urbanovich 13 yıl önce
ebeveyn
işleme
dbbf864bb9
1 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. +4
    -2
      c_src/encoder.c

+ 4
- 2
c_src/encoder.c Dosyayı Görüntüle

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

Yükleniyor…
İptal
Kaydet