mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
Use snprintf instead of sprintf (ref #4361)
This commit is contained in:
parent
5522cdd201
commit
7e5655eef4
@ -51,7 +51,7 @@ std::string to_hex(const char* blob, std::size_t size)
|
||||
std::memset(hex, 0, 3);
|
||||
for (std::size_t pos = 0; pos < size; ++pos)
|
||||
{
|
||||
std::sprintf(hex, "%02x", int(blob[pos]) & 0xff);
|
||||
std::snprintf(hex, 3, "%02x", int(blob[pos]) & 0xff);
|
||||
s << hex;
|
||||
}
|
||||
return s.str();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user