mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-29 13:01:14 +03:00
example, tests: address compiler warnings
Fix or silence all C compiler warnings discovered with (or without) `PICKY_COMPILER=ON` (in CMake). This means all warnings showing up in CI (gcc, clang, MSVS 2013/2015), in local tests on macOS (clang 14) and Windows cross-builds using gcc (12) and llvm/clang (14/15). Also fix the expression `nread -= nread` in `sftp_RW_nonblock.c`. Cherry-picked from: #846 Closes #861
This commit is contained in:
@ -33,13 +33,13 @@ int test(LIBSSH2_SESSION *session)
|
||||
|
||||
if(type == LIBSSH2_HOSTKEY_TYPE_ECDSA_256) {
|
||||
rc = libssh2_base64_decode(session, &expected_hostkey, &expected_len,
|
||||
EXPECTED_ECDSA_HOSTKEY,
|
||||
strlen(EXPECTED_ECDSA_HOSTKEY));
|
||||
EXPECTED_ECDSA_HOSTKEY,
|
||||
(unsigned int)strlen(EXPECTED_ECDSA_HOSTKEY));
|
||||
}
|
||||
else if(type == LIBSSH2_HOSTKEY_TYPE_RSA) {
|
||||
rc = libssh2_base64_decode(session, &expected_hostkey, &expected_len,
|
||||
EXPECTED_RSA_HOSTKEY,
|
||||
strlen(EXPECTED_RSA_HOSTKEY));
|
||||
EXPECTED_RSA_HOSTKEY,
|
||||
(unsigned int)strlen(EXPECTED_RSA_HOSTKEY));
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Unexpected type of hostkey: %i\n", type);
|
||||
|
Reference in New Issue
Block a user