Ensure that string_create allocates extra byte for NULL-terminator in all cases
Rename a get_next_inventory_entry parameter (missing in previous commit)
Don't modify the length of directory name string objects

Keep track of the modified length in an additional variable.