Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
example, tests: fix/silence
-Wformat-truncation=2
gcc warnings
Then sync this warning option with curl. Seems like a false positive and/or couldn't figure how to fix it, so silence: ``` example/ssh2.c:227:38: error: '%s' directive output may be truncated writing likely 1 or more bytes into a region of size 0 [-Werror=format-truncation=] 227 | snprintf(fn1, fn1sz, "%s/%s", h, pubkey); | ^~ example/ssh2.c:227:34: note: assuming directive output of 1 byte 227 | snprintf(fn1, fn1sz, "%s/%s", h, pubkey); | ^~~~~~~ example/ssh2.c:227:13: note: 'snprintf' output 3 or more bytes (assuming 4) into a destination of size 2 227 | snprintf(fn1, fn1sz, "%s/%s", h, pubkey); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ example/ssh2.c:228:38: error: '%s' directive output may be truncated writing likely 1 or more bytes into a region of size 0 [-Werror=format-truncation=] 228 | snprintf(fn2, fn2sz, "%s/%s", h, privkey); | ^~ example/ssh2.c:228:34: note: assuming directive output of 1 byte 228 | snprintf(fn2, fn2sz, "%s/%s", h, privkey); | ^~~~~~~ example/ssh2.c:228:13: note: 'snprintf' output 3 or more bytes (assuming 4) into a destination of size 2 228 | snprintf(fn2, fn2sz, "%s/%s", h, privkey); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Ref: https://github.com/libssh2/libssh2/actions/runs/7055480458/job/19205970397#step:10:98 Fix: ``` tests/openssh_fixture.c:116:38: error: ' 2>&1' directive output may be truncated writing 5 bytes into a region of size between 1 and 1024 [-Werror=format-truncation=] tests/openssh_fixture.c:116:11: note: 'snprintf' output between 6 and 1029 bytes into a destination of size 1024 ``` Ref: https://github.com/libssh2/libssh2/actions/runs/7055480458/job/19205969221#step:10:51 Tested via libssh2#1257
- Loading branch information