Maintenance

1. Clean up a few compiler warnings.
2. Between Windows, MacOS, and Linux, the %llu printf tag varies
slightly, add a typecast of the word64 to unsigned long long to hush the
compiler warning.
pull/197/head
John Safranek 2019-09-11 14:10:16 -07:00
parent acd80a1976
commit 365be7d63c
2 changed files with 6 additions and 5 deletions

View File

@ -53,7 +53,8 @@ static void myStatusCb(WOLFSSH* sshIn, word32* bytes, char* name)
{
char buf[80];
word64 longBytes = ((word64)bytes[1] << 32) | bytes[0];
WSNPRINTF(buf, sizeof(buf), "Processed %8ld\t bytes \r", longBytes);
WSNPRINTF(buf, sizeof(buf), "Processed %8llu\t bytes \r",
(unsigned long long)longBytes);
WFPUTS(buf, fout);
(void)name;
(void)sshIn;
@ -1229,7 +1230,7 @@ THREAD_RETURN WOLFSSH_THREAD sftpclient_test(void* args)
(word32)WSTRLEN(hanselPublicEcc),
(byte*)userPublicKey, &userPublicKeySz);
strncpy((char*)userPublicKeyType, "ecdsa-sha2-nistp256",
WSTRNCPY((char*)userPublicKeyType, "ecdsa-sha2-nistp256",
sizeof(userPublicKeyType));
userPrivateKey = hanselPrivateEcc;
userPrivateKeySz = hanselPrivateEccSz;
@ -1240,7 +1241,7 @@ THREAD_RETURN WOLFSSH_THREAD sftpclient_test(void* args)
(word32)WSTRLEN(hanselPublicRsa),
(byte*)userPublicKey, &userPublicKeySz);
strncpy((char*)userPublicKeyType, "ssh-rsa",
WSTRNCPY((char*)userPublicKeyType, "ssh-rsa",
sizeof(userPublicKeyType));
userPrivateKey = hanselPrivateRsa;
userPrivateKeySz = hanselPrivateRsaSz;

View File

@ -7287,7 +7287,7 @@ int wolfSSH_SFTP_Put(WOLFSSH* ssh, char* from, char* to, byte resume,
if (resume) {
WMEMSET(&state->offset, 0, sizeof(OVERLAPPED));
state->offset.OffsetHigh = 0;
state->offset.Offset = (DWORD)state->pOfst;
state->offset.Offset = state->pOfst[0];
}
#endif /* USE_WINDOWS_API */
state->rSz = 0;
@ -7342,7 +7342,7 @@ int wolfSSH_SFTP_Put(WOLFSSH* ssh, char* from, char* to, byte resume,
AddAssign64(state->pOfst, sz);
#ifdef USE_WINDOWS_API
state->offset.OffsetHigh = 0;
state->offset.Offset = (DWORD)state->pOfst;
state->offset.Offset = state->pOfst[0];
#endif /* USE_WINDOWS_API */
state->rSz -= sz;
if (statusCb != NULL) {