mirror of
https://github.com/pocoproject/poco.git
synced 2025-12-11 02:25:59 +01:00
GH #3876: Replace sprintf with snprintf in Environment and NumberFormatter to avoid deprecation warnings
This commit is contained in:
@@ -477,9 +477,9 @@ void NumberFormatter::append(std::string& str, const void* ptr)
|
||||
{
|
||||
char buffer[24];
|
||||
#if defined(POCO_PTR_IS_64_BIT)
|
||||
std::sprintf(buffer, "%016" PRIXPTR, (UIntPtr) ptr);
|
||||
std::snprintf(buffer, sizeof(buffer), "%016" PRIXPTR, (UIntPtr) ptr);
|
||||
#else
|
||||
std::sprintf(buffer, "%08" PRIXPTR, (UIntPtr) ptr);
|
||||
std::snprintf(buffer, sizeof(buffer), "%08" PRIXPTR, (UIntPtr) ptr);
|
||||
#endif
|
||||
str.append(buffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user