clang: fix -Wpointer-sign warning

../../../../src/vfs/sftpfs/connection.c:787:22: warning: passing 'unsigned char *const' to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
        if (strncmp (prompts[i].text, "Password: ", prompts[i].length) == 0)
                     ^~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h:84:26: note: passing argument to parameter '__s1' here
int      strncmp(const char *__s1, const char *__s2, size_t __n);
                             ^

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Yury V. Zaytsev 2024-05-30 21:28:00 +02:00 committed by Andrew Borodin
parent 482025a286
commit de06f36ccf

View File

@ -784,7 +784,7 @@ LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC (sftpfs_keyboard_interactive_helper)
len = strlen (kbi_passwd);
for (i = 0; i < num_prompts; ++i)
if (strncmp (prompts[i].text, "Password: ", prompts[i].length) == 0)
if (memcmp (prompts[i].text, "Password: ", prompts[i].length) == 0)
{
responses[i].text = strdup (kbi_passwd);
responses[i].length = len;