...and have that call manage replaced memory in the output structure.
This makes the size_t comparison test nicer (assuming that the values are actually not using the full length), and converts some cases that were using it for pointer comparison to use the macro that is designed for pointer comparison.