# HG changeset patch # User Paul Boddie # Date 1488751256 -3600 # Node ID 4f77c6b2fc68034ec240db8923aadefda7190fd6 # Parent ef6dacfb039203b5b2ca72d459511b8b6bc28840 Fixed concatenated list size initialisation. diff -r ef6dacfb0392 -r 4f77c6b2fc68 templates/native/list.c --- a/templates/native/list.c Sun Mar 05 22:38:54 2017 +0100 +++ b/templates/native/list.c Sun Mar 05 23:00:56 2017 +0100 @@ -75,12 +75,11 @@ __fragment *newdata = data; unsigned int size = data->size, capacity = data->capacity; unsigned int other_size = other_data->size; - unsigned int i, j, n; + unsigned int i, j, n = size + other_size; /* Re-allocate the fragment if the capacity has been reached. */ - if (size + other_size >= capacity) + if (n >= capacity) { - n = size + other_size; newdata = (__fragment *) __REALLOCATE(data, __FRAGMENT_SIZE(n)); newdata->capacity = n; }