diff options
author | Jose <pepone@users.noreply.github.com> | 2022-07-06 20:16:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-06 20:16:19 +0200 |
commit | b61b3b9f4ee5e545df8c4cb69e57ed242aac97e8 (patch) | |
tree | ddad6d2a4fbf2643eb838781e43ef16b06687a41 /cpp/src | |
parent | Update Windows CI python builds (diff) | |
download | ice-b61b3b9f4ee5e545df8c4cb69e57ed242aac97e8.tar.bz2 ice-b61b3b9f4ee5e545df8c4cb69e57ed242aac97e8.tar.xz ice-b61b3b9f4ee5e545df8c4cb69e57ed242aac97e8.zip |
Replace sprintf/vsprintf with snprintf/vsnprintf (#1379)
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IceUtil/OutputUtil.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cpp/src/IceUtil/OutputUtil.cpp b/cpp/src/IceUtil/OutputUtil.cpp index 05e39729f63..2584cc8d1a1 100644 --- a/cpp/src/IceUtil/OutputUtil.cpp +++ b/cpp/src/IceUtil/OutputUtil.cpp @@ -34,10 +34,15 @@ IceUtilInternal::int64ToString(Int64 val) #if defined(_WIN32) sprintf_s(buf, sizeof(buf), "%I64d", val); -#elif defined(ICE_64) - sprintf(buf, "%ld", val); // Avoids a format warning from GCC. +#elif defined(__APPLE__) + // sprintf is deprecated with macOS Ventura + snprintf(buf, sizeof(buf), "%ld", val); // Avoids a format warning from GCC. #else +# if defined(ICE_64) + sprintf(buf, "%ld", val); // Avoids a format warning from GCC. +# else sprintf(buf, "%lld", val); +# endif #endif return string(buf); } |