diff --git a/src/filter/graph.rs b/src/filter/graph.rs index 1654e6e1..b63cd6cb 100644 --- a/src/filter/graph.rs +++ b/src/filter/graph.rs @@ -161,7 +161,13 @@ impl<'a> Parser<'a> { if self.inputs.is_null() { self.inputs = input; } else { - (*self.inputs).next = input; + let mut prev_input = self.inputs; + let mut next_input = (*prev_input).next; + while !next_input.is_null() { + prev_input = next_input; + next_input = (*next_input).next; + } + (*prev_input).next = input; } } @@ -187,7 +193,13 @@ impl<'a> Parser<'a> { if self.outputs.is_null() { self.outputs = output; } else { - (*self.outputs).next = output; + let mut prev_output = self.outputs; + let mut next_output = (*prev_output).next; + while !next_output.is_null() { + prev_output = next_output; + next_output = (*next_output).next; + } + (*prev_output).next = output; } }