Fix invalid sprintf() to a std::string

The sprintf(tmp, ...) with tmp as an std::string object failed to compile. Convert to 128-byte static buffer.