diff --git a/lib/charms/defm/expander.ex b/lib/charms/defm/expander.ex index fb0b468..2c4b87c 100644 --- a/lib/charms/defm/expander.ex +++ b/lib/charms/defm/expander.ex @@ -500,7 +500,7 @@ defmodule Charms.Defm.Expander do term_ptr = Pointer.allocate(Term.t()) size = String.length(attr) buffer_ptr = Pointer.allocate(i8(), size) - buffer = ptr_to_memref(buffer_ptr) + buffer = ptr_to_memref(buffer_ptr, size) memref.copy(attr, buffer) zero = const 0 :: i32() enif_binary_to_term(unquote(env_var), buffer_ptr, size, term_ptr, zero)