diff options
Diffstat (limited to 'c_src/sd_notify.c')
-rw-r--r-- | c_src/sd_notify.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/c_src/sd_notify.c b/c_src/sd_notify.c index 9edf737..5c21be4 100644 --- a/c_src/sd_notify.c +++ b/c_src/sd_notify.c @@ -45,7 +45,7 @@ static ERL_NIF_TERM sd_pid_notify_with_fds_nif(ErlNifEnv* env, int argc, const E enif_get_string(env, argv[2], state, length, ERL_NIF_LATIN1); enif_get_list_length(env, argv[3], &length); - int* fds = (int*)enif_alloc(++length * sizeof(int)); + int* fds = (int*)enif_alloc(length * sizeof(int)); ERL_NIF_TERM list = argv[3]; int i = 0; while(enif_get_list_cell(env, list, &head, &tail)) { @@ -61,7 +61,6 @@ static ERL_NIF_TERM sd_pid_notify_with_fds_nif(ErlNifEnv* env, int argc, const E return enif_make_int(env, result); } - static ErlNifFunc nif_funcs[] = { {"sd_pid_notify_with_fds", 4, sd_pid_notify_with_fds_nif}, |