Skip to content

Commit

Permalink
Merge pull request #160 from JacobBarthelmeh/testing
Browse files Browse the repository at this point in the history
fix for gcc 8 build warnings
  • Loading branch information
ejohnstown authored Apr 30, 2019
2 parents 8a3c94a + 1fd4c2c commit 4ce4b72
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/wolfscp.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,9 +697,9 @@ WOLFSSH_API int wolfSSH_SetScpErrorMsg(WOLFSSH* ssh, const char* message)
ret = WS_BAD_ARGUMENT;

if (ret == WS_SUCCESS) {
valueSz = (word32)WSTRLEN(message);
valueSz = (word32)WSTRLEN(message) + 1;
if (valueSz > 0)
value = (char*)WMALLOC(valueSz + SCP_MIN_CONFIRM_SZ + 1,
value = (char*)WMALLOC(valueSz + SCP_MIN_CONFIRM_SZ,
ssh->ctx->heap, DYNTYPE_STRING);
if (value == NULL)
ret = WS_MEMORY_E;
Expand All @@ -708,8 +708,8 @@ WOLFSSH_API int wolfSSH_SetScpErrorMsg(WOLFSSH* ssh, const char* message)
if (ret == WS_SUCCESS) {
/* leave room for cmd at beginning, add \n\0 at end */
WSTRNCPY(value + 1, message, valueSz);
*(value + valueSz + 1) = '\n';
*(value + valueSz + 2) = '\0';
*(value + valueSz) = '\n';
*(value + valueSz + 1) = '\0';

if (ssh->scpConfirmMsg != NULL) {
WFREE(ssh->scpConfirmMsg, ssh->ctx->heap, DYNTYPE_STRING);
Expand Down Expand Up @@ -1071,7 +1071,7 @@ static int ParseBasePathHelper(WOLFSSH* ssh, int cmdSz)
return WS_BUFFER_E;
}

WSTRNCPY(buf, ssh->scpBasePath, sz);
WSTRNCPY(buf, ssh->scpBasePath, cmdSz);
buf[sz] = '\0';
WSTRNCAT(buf, "/..", sizeof("/.."));
clean_path(buf);
Expand Down
2 changes: 1 addition & 1 deletion src/wolfsftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ static int wolfSSH_SFTP_RecvRealPath(WOLFSSH* ssh, int reqId, byte* data,
if (r[0] != '/' && r[1] != ':') {
char wd[WOLFSSH_MAX_FILENAME];
if (ssh->sftpDefaultPath) {
XSTRNCPY(wd, ssh->sftpDefaultPath, sizeof(wd));
XSTRNCPY(wd, ssh->sftpDefaultPath, WOLFSSH_MAX_FILENAME - 1);
}
else {
#ifndef USE_WINDOWS_API
Expand Down

0 comments on commit 4ce4b72

Please sign in to comment.