Просмотр исходного кода

Tweak the nil encoding logic

I must've managed to miss the PR update from Stanislav the other day
when merging this.
pull/72/head
Paul J. Davis 10 лет назад
Родитель
Сommit
5eb499d73e
1 измененных файлов: 6 добавлений и 2 удалений
  1. +6
    -2
      c_src/encoder.c

+ 6
- 2
c_src/encoder.c Просмотреть файл

@ -713,11 +713,15 @@ encode_iter(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
stack = enif_make_list_cell(env, e->atoms->ref_array, stack);
stack = enif_make_list_cell(env, item, stack);
} else if(enif_compare(curr, e->atoms->atom_null) == 0
|| (e->use_nil && enif_compare(curr, e->atoms->atom_nil) == 0)) {
if(!enc_literal(e, "null", 4)) {
ret = enc_error(e, "null");
goto done;
}
}
} else if(e->use_nil && enif_compare(curr, e->atoms->atom_nil) == 0)) {
if(!enc_literal(e, "null", 4)) {
ret = enc_error(e, "null");
goto done;
}
} else if(enif_compare(curr, e->atoms->atom_true) == 0) {
if(!enc_literal(e, "true", 4)) {
ret = enc_error(e, "true");

Загрузка…
Отмена
Сохранить