diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-11-30 12:42:21 +0100 |
---|---|---|
committer | Pranam Lashkari <lpranam@collabora.com> | 2022-10-27 14:00:03 +0200 |
commit | 4634c5b49ffb770e97f369d2143565e8aca45b2f (patch) | |
tree | d1f8806f0476a73bdc5cb14711e47511c4215651 /vcl/qa | |
parent | 8990b0c97c1266253cdb2464604ab17e4101eccc (diff) |
Improve an snprintf printing css::util::DateTime members
...to avoid GCC 12 trunk
> extensions/source/logging/csvformatter.cxx: In member function ‘virtual rtl::OUString logging::{anonymous}::CsvFormatter::format(const com::sun::star::logging::LogRecord&)’:
> extensions/source/logging/csvformatter.cxx:241:70: error: ‘%02i’ directive output may be truncated writing between 2 and 5 bytes into a region of size between 0 and 14 [-Werror=format-truncation=]
> 241 | snprintf( buffer, buffer_size, "%04i-%02i-%02iT%02i:%02i:%02i.%09i",
> | ^~~~
> extensions/source/logging/csvformatter.cxx:241:44: note: directive argument in the range [0, 65535]
> 241 | snprintf( buffer, buffer_size, "%04i-%02i-%02iT%02i:%02i:%02i.%09i",
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> extensions/source/logging/csvformatter.cxx:241:44: note: using the range [-2147483648, 2147483647] for directive argument
> extensions/source/logging/csvformatter.cxx:241:21: note: ‘snprintf’ output between 30 and 49 bytes into a destination of size 31
> 241 | snprintf( buffer, buffer_size, "%04i-%02i-%02iT%02i:%02i:%02i.%09i",
> | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 242 | static_cast<int>(record.LogTime.Year),
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 243 | static_cast<int>(record.LogTime.Month),
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 244 | static_cast<int>(record.LogTime.Day),
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 245 | static_cast<int>(record.LogTime.Hours),
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 246 | static_cast<int>(record.LogTime.Minutes),
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 247 | static_cast<int>(record.LogTime.Seconds),
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 248 | static_cast<int>(record.LogTime.NanoSeconds) );
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change-Id: I426fd6c54b69c7dcc2153167961295c3bc5cf91f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126116
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 33a7e65502857687e778444c9b55500b40b4df19)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141848
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Pranam Lashkari <lpranam@collabora.com>
Diffstat (limited to 'vcl/qa')
0 files changed, 0 insertions, 0 deletions