s3-lib Move realloc based string substitution functions out of util_str.c