Skip to content

Commit

Permalink
Segfault problem
Browse files Browse the repository at this point in the history
  • Loading branch information
ratelle committed Sep 2, 2014
1 parent f64a5de commit dd2d1fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions c_src/geohash_nif.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ internal_build_index(ErlNifEnv *env, ERL_NIF_TERM lst, ERL_NIF_TERM iterations)
errors = (ERL_NIF_TERM *)malloc(len * sizeof(ERL_NIF_TERM));

unsigned i;
unsigned j = 0;
for (i = 0; i < len; i++)
{
ERL_NIF_TERM current;
Expand All @@ -169,8 +170,8 @@ internal_build_index(ErlNifEnv *env, ERL_NIF_TERM lst, ERL_NIF_TERM iterations)
errors[n_errors++] = tuple[0];
else
{
values[i] = value;
vectors[i] = *wrapper;
values[j] = value;
vectors[j++] = *wrapper;
}
}

Expand Down

0 comments on commit dd2d1fe

Please sign in to comment.