'%02d' directive output may be truncated writing between 2 and 11 bytes into a region of size between 9 and 16 [-Werror=
Posted: Fri Apr 29, 2022 9:00 am
Hello,
I need help.
after Build I get this Error:
I need Help
/main/main.cpp:787:42: error: '%02d' directive output may be truncated writing between 2 and 11 bytes into a region of size between 9 and 16 [-Werror=format-truncation=]
snprintf(ts_buf, ts_bufsize, "%04d-%02d-%02dT%02d:%02d:%02dZ",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../main/main.cpp:787:42: note: directive argument in the range [-2147483647, 2147483647]
../main/main.cpp:787:21: note: 'snprintf' output between 21 and 73 bytes into a destination of size 21
snprintf(ts_buf, ts_bufsize, "%04d-%02d-%02dT%02d:%02d:%02dZ",
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
utc_time.tm_year+1900,
~~~~~~~~~~~~~~~~~~~~~~
utc_time.tm_mon+1,
~~~~~~~~~~~~~~~~~~
utc_time.tm_mday,
~~~~~~~~~~~~~~~~~
utc_time.tm_hour,
~~~~~~~~~~~~~~~~~
utc_time.tm_min,
~~~~~~~~~~~~~~~~
utc_time.tm_sec
~~~~~~~~~~~~~~~
);
~
cc1plus.exe: some warnings being treated as errors
ninja: build stopped: subcommand failed.
I need help.
after Build I get this Error:
I need Help
/main/main.cpp:787:42: error: '%02d' directive output may be truncated writing between 2 and 11 bytes into a region of size between 9 and 16 [-Werror=format-truncation=]
snprintf(ts_buf, ts_bufsize, "%04d-%02d-%02dT%02d:%02d:%02dZ",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../main/main.cpp:787:42: note: directive argument in the range [-2147483647, 2147483647]
../main/main.cpp:787:21: note: 'snprintf' output between 21 and 73 bytes into a destination of size 21
snprintf(ts_buf, ts_bufsize, "%04d-%02d-%02dT%02d:%02d:%02dZ",
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
utc_time.tm_year+1900,
~~~~~~~~~~~~~~~~~~~~~~
utc_time.tm_mon+1,
~~~~~~~~~~~~~~~~~~
utc_time.tm_mday,
~~~~~~~~~~~~~~~~~
utc_time.tm_hour,
~~~~~~~~~~~~~~~~~
utc_time.tm_min,
~~~~~~~~~~~~~~~~
utc_time.tm_sec
~~~~~~~~~~~~~~~
);
~
cc1plus.exe: some warnings being treated as errors
ninja: build stopped: subcommand failed.