From da3135f345a6a1ee307b3d4f20aa824ea32884a3 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 16 Aug 2019 10:16:25 -0600 Subject: [PATCH] fix comments and add in more --- src/wolfsftp.c | 13 +++++++++---- wolfssh/wolfsftp.h | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/wolfsftp.c b/src/wolfsftp.c index 67235e0..681260f 100644 --- a/src/wolfsftp.c +++ b/src/wolfsftp.c @@ -4971,6 +4971,7 @@ static int wolfSSH_SFTP_GetHandle(WOLFSSH* ssh, byte* handle, word32* handleSz) if (state->bufSz > WOLFSSH_MAX_HANDLE || *handleSz < state->bufSz) { WLOG(WS_LOG_SFTP, "Handle size found was too big"); + WLOG(WS_LOG_SFTP, "Check size set in input handleSz"); ssh->error = WS_BUFFER_E; ret = WS_FATAL_ERROR; state->state = STATE_GET_HANDLE_CLEANUP; @@ -5626,7 +5627,8 @@ int wolfSSH_SFTP_Open(WOLFSSH* ssh, char* dir, word32 reason, * * handle file handle given by sftp server * handleSz size of handle - * ofst offset to start writing at + * ofst offset to start reading at. 2 word32 array with value at ofst[0] + * being the lower and ofst[1] being the upper. * in data to be written * inSz amount of data to be written from "in" buffer * @@ -5836,7 +5838,8 @@ int wolfSSH_SFTP_SendWritePacket(WOLFSSH* ssh, byte* handle, word32 handleSz, * * handle file handle given by sftp server * handleSz size of handle - * ofst offset to start reading at + * ofst offset to start reading at. 2 word32 array with value at ofst[0] + * being the lower and ofst[1] being the upper. * out buffer to hold resulting data read * outSz size of "out" buffer * @@ -6824,7 +6827,8 @@ int wolfSSH_SFTP_RMDIR(WOLFSSH* ssh, char* dir) * * frm NULL terminated string holding the from name * to NULL terminated string holding the to name - * ofst offset into file that should be saved + * ofst offset into file that should be saved. 2 word32 array with value at + * ofst[0] being the lower and ofst[1] being the upper. * * return WS_SUCCESS on success */ @@ -6875,7 +6879,8 @@ int wolfSSH_SFTP_SaveOfst(WOLFSSH* ssh, char* frm, char* to, const word32* ofst) * * frm NULL terminated string holding the from name * to NULL terminated string holding the to name - * ofst put the offset here, set to zero then updated + * ofst put the offset here, set to zero then updated. 2 word32 array with + * value at ofst[0] being the lower and ofst[1] being the upper. * * returns WS_SUCCESS is returned */ diff --git a/wolfssh/wolfsftp.h b/wolfssh/wolfsftp.h index d244241..f8fe61b 100644 --- a/wolfssh/wolfsftp.h +++ b/wolfssh/wolfsftp.h @@ -125,7 +125,7 @@ struct WS_SFTP_FILEATRB_EX { typedef struct WS_SFTP_FILEATRB { word32 flags; - word32 sz[2]; + word32 sz[2]; /* sz[0] being the lower and sz[1] being the upper */ word32 uid; /* user ID */ word32 gid; /* group ID */ word32 per; /* permissions */