summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-11-05 16:03:27 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-11-05 19:19:06 +0100
commit3eee720ce275d7fad195ac6bfa44dd596eb87b64 (patch)
tree4c5a679e678888f1e35a6beef0b32a887cfedcee /svl
parent8fe04bc08cb3007fa4fe07b0a6a189aa4eb37092 (diff)
-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 <sbergman@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/misc/lockfilecommon.cxx5
-rw-r--r--svl/source/numbers/zformat.cxx4
2 files changed, 4 insertions, 5 deletions
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());
}