From 69b91a3a2ea3ebaf5fee48ea28d70dffd71fa7cc Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 17 Sep 2020 11:16:22 -0600 Subject: [PATCH] adjust size of strncpy and time limit --- examples/sftpclient/sftpclient.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/sftpclient/sftpclient.c b/examples/sftpclient/sftpclient.c index c8c45f3..dbddab3 100644 --- a/examples/sftpclient/sftpclient.c +++ b/examples/sftpclient/sftpclient.c @@ -55,9 +55,9 @@ static void err_msg(const char* s) #ifndef WOLFSSH_NO_TIMESTAMP #include - static char currentFile[WOLFSSH_MAX_FILENAME] = ""; + static char currentFile[WOLFSSH_MAX_FILENAME+1] = ""; static double startTime; - #define TIMEOUT_VALUE 60 + #define TIMEOUT_VALUE 120 double current_time(int); double current_time(int reset) @@ -83,7 +83,7 @@ static void myStatusCb(WOLFSSH* sshIn, word32* bytes, char* name) if (WSTRNCMP(currentFile, name, WSTRLEN(name)) != 0) { startTime = current_time(1); WMEMSET(currentFile, 0, WOLFSSH_MAX_FILENAME); - WSTRNCPY(currentFile, name, WSTRLEN(name)); + WSTRNCPY(currentFile, name, WOLFSSH_MAX_FILENAME); } currentTime = current_time(0) - startTime; WSNPRINTF(buf, sizeof(buf), "Processed %8llu\t bytes in %.2f seconds\r",