aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/sometime.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-10-21 10:48:46 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-11-14 19:38:23 +0000
commit4605b07f44df6b96e17997782fedf0d16a7e933a (patch)
tree62fa8ea05bbf77af3ed6c4af69e97b06d4359d3d /sources/shiboken6/tests/libsample/sometime.cpp
parentceefd6862f717c780b9ad7702fdde9352c780d66 (diff)
replace sprintf by snprintf6.3
The function sprintf is deprecated and easily replaced by the secure snprintf version. Change-Id: I6b97d71ae179f9a6627fd5e39451e7a2f2322497 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 15436a08f9cde34f2594b192314ad842906f9ed1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'sources/shiboken6/tests/libsample/sometime.cpp')
-rw-r--r--sources/shiboken6/tests/libsample/sometime.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/shiboken6/tests/libsample/sometime.cpp b/sources/shiboken6/tests/libsample/sometime.cpp
index 5afc48db4..be6c2e70f 100644
--- a/sources/shiboken6/tests/libsample/sometime.cpp
+++ b/sources/shiboken6/tests/libsample/sometime.cpp
@@ -71,7 +71,7 @@ Time::toString() const
if (m_is_null)
return Str();
char buffer[13];
- sprintf(buffer, "%02d:%02d:%02d.%03d", m_hour, m_minute, m_second, m_msec);
+ snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d.%03d", m_hour, m_minute, m_second, m_msec);
return Str(buffer);
}