Commit fe7b6fac authored by Stefan Westerfeld's avatar Stefan Westerfeld

Replace sprintf with string_printf.

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 5a836c95
...@@ -154,11 +154,7 @@ TSWriter::process (const string& inname, const string& outname) ...@@ -154,11 +154,7 @@ TSWriter::process (const string& inname, const string& outname)
for (auto entry : entries) for (auto entry : entries)
{ {
char buf[1024]; string header = string_printf ("%zd:%s", entry.data.size(), entry.name.c_str()) + '\0';
sprintf (buf, "%zd", entry.data.size());
string header = buf;
header += ":" + entry.name;
header += '\0';
vector<unsigned char> data = entry.data; vector<unsigned char> data = entry.data;
for (size_t i = 0; i < header.size(); i++) for (size_t i = 0; i < header.size(); i++)
data.insert (data.begin() + i, header[i]); data.insert (data.begin() + i, header[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment