svl/source/misc/lockfilecommon.cxx | 5 ++--- svl/source/numbers/zformat.cxx | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-)
New commits: commit 3eee720ce275d7fad195ac6bfa44dd596eb87b64 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Sat Nov 5 16:03:27 2022 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Sat Nov 5 19:19:06 2022 +0100 -Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): svl Change-Id: Ia7e9ce9f93fbc48db412678da541fda4f1f7717f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142334 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/svl/source/misc/lockfilecommon.cxx b/svl/source/misc/lockfilecommon.cxx index 0a867c5dd261..bcf568b70aa6 100644 --- a/svl/source/misc/lockfilecommon.cxx +++ b/svl/source/misc/lockfilecommon.cxx @@ -18,8 +18,6 @@ */ -#include <stdio.h> - #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/io/WrongFormatException.hpp> @@ -28,6 +26,7 @@ #include <osl/socket.hxx> #include <osl/file.hxx> #include <o3tl/enumrange.hxx> +#include <o3tl/sprintf.hxx> #include <rtl/ustring.hxx> #include <rtl/strbuf.hxx> @@ -210,7 +209,7 @@ OUString LockFileCommon::GetCurrentLocalTime() { char pDateTime[sizeof("65535.65535.-32768 65535:65535")]; // reserve enough space for hypothetical max length - sprintf( pDateTime, "%02" SAL_PRIuUINT32 ".%02" SAL_PRIuUINT32 ".%4" SAL_PRIdINT32 " %02" SAL_PRIuUINT32 ":%02" SAL_PRIuUINT32, sal_uInt32(aDateTime.Day), sal_uInt32(aDateTime.Month), sal_Int32(aDateTime.Year), sal_uInt32(aDateTime.Hours), sal_uInt32(aDateTime.Minutes) ); + o3tl::sprintf( pDateTime, "%02" SAL_PRIuUINT32 ".%02" SAL_PRIuUINT32 ".%4" SAL_PRIdINT32 " %02" SAL_PRIuUINT32 ":%02" SAL_PRIuUINT32, sal_uInt32(aDateTime.Day), sal_uInt32(aDateTime.Month), sal_Int32(aDateTime.Year), sal_uInt32(aDateTime.Hours), sal_uInt32(aDateTime.Minutes) ); aTime = OUString::createFromAscii( pDateTime ); } } diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index dfe5f16096e2..b675ed7cca99 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <stdio.h> #include <string_view> +#include <o3tl/sprintf.hxx> #include <o3tl/string_view.hxx> #include <comphelper/string.hxx> #include <sal/log.hxx> @@ -2942,7 +2942,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, else { char aBuf[100]; - sprintf( aBuf, "%.f", fNum ); // simple rounded integer (#100211# - checked) + o3tl::sprintf( aBuf, "%.f", fNum ); // simple rounded integer sStr.appendAscii( aBuf ); impTransliterate(sStr, NumFor[nIx].GetNatNum()); }