diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-02-21 10:59:04 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2023-05-09 19:59:41 +0200 |
commit | 5f9aab1993016720db1d7008ed190b0a96293190 (patch) | |
tree | 4188145a3f54a918ee0e73fdc9e9ac4977f2a6ef /examples/cppunittest/MessageTest.cpp | |
parent | 01037c3ebee72192e31e44f5d38baf575832e77d (diff) | |
download | cppunit-5f9aab1993016720db1d7008ed190b0a96293190.tar.gz |
Use snprintf instead of sprintf
See
<https://git.libreoffice.org/core/+/bd8a213c8ceccf66ab296ef0aea0fa4c451047e5%5E%21>
"external/cppunit: Use snprintf instead of sprintf" for how sprintf would have
caused deprecation warnings on macOS.
(For MSVC, keep using sprintf_s. According to
<https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l?view=msvc-170>:
"Beginning with the UCRT in Visual Studio 2015 and Windows 10, snprintf is no
longer identical to _snprintf. The snprintf function behavior is now C99
standard conformant." So for older versions, snprintf would potentially not
store a terminating NUL, like _snprintf but unlike sprintf_s.)
Change-Id: Ibf8b228cd1dd57428ecf85ed10e0793b78ae90c9
Reviewed-on: https://gerrit.libreoffice.org/c/cppunit/+/147383
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'examples/cppunittest/MessageTest.cpp')
0 files changed, 0 insertions, 0 deletions