On 2/17/22 1:47 AM, Craig Small wrote:
I can't find an email if I gave specifics about the warnings or not, but they are below.
This seems a bit of a bogus warning. You are using snprintf() with a %s which could be a long string and limiting it to 4 characters.
The issue is, not checking the return value. But! you know what the source string is (another window name) so it won't be larger than 4 and truncate.
There are probably three ways ahead with this:
* Disable the warning when using --enable-harden-flags
* Add a compiler note to not complain
* Change the top.c code to check the return value
I see not a lot of value of this warning, especially in this context; what's your view?