loci: fix of_wire_buffer_replace_data for non-trailing members
The previous code only worked correctly if the member being grown was the last
non-zero-length member in the object.
diff --git a/c_gen/templates/of_wire_buf.c b/c_gen/templates/of_wire_buf.c
index 054dc01..13da8e3 100644
--- a/c_gen/templates/of_wire_buf.c
+++ b/c_gen/templates/of_wire_buf.c
@@ -138,11 +138,7 @@
/* Doesn't make sense; mismatch in current buffer info */
ASSERT(old_len + offset <= wbuf->current_bytes);
- if (old_len < new_len) {
- of_wire_buffer_grow(wbuf, offset + new_len);
- } else {
- wbuf->current_bytes += (new_len - old_len); // may decrease size
- }
+ wbuf->current_bytes += (new_len - old_len); // may decrease size
if ((old_len + offset < cur_bytes) && (old_len != new_len)) {
/* Need to move back of buffer */