From 52a1e13470c7619fa3bc86af1f0b59836d609fc9 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Tue, 16 Feb 2021 13:20:19 +0100 Subject: [PATCH] Fixed compiler warnings, pre-commit tests --- src/log.c | 6 +++++- src/wolfscp.c | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/log.c b/src/log.c index 2e57201..2fbef7c 100644 --- a/src/log.c +++ b/src/log.c @@ -57,8 +57,8 @@ #endif /* WOLFSSH_NO_DEFAULT_LOGGING_CB */ -static enum wolfSSH_LogLevel logLevel = WS_LOG_DEFAULT; #ifdef DEBUG_WOLFSSH + static enum wolfSSH_LogLevel logLevel = WS_LOG_DEFAULT; static int logEnable = 0; #endif @@ -180,10 +180,14 @@ void wolfSSH_Log(enum wolfSSH_LogLevel level, const char *const fmt, ...) #else void DefaultLoggingCb(enum wolfSSH_LogLevel level, const char *const msgStr) { + (void)level; + (void)msgStr; } void wolfSSH_Log(enum wolfSSH_LogLevel level, const char *const fmt, ...) { + (void)level; + (void)fmt; } #endif /* DEBUG_WOLFSSH */ diff --git a/src/wolfscp.c b/src/wolfscp.c index 4f8b04e..88171e8 100644 --- a/src/wolfscp.c +++ b/src/wolfscp.c @@ -894,7 +894,7 @@ static int GetScpFileSize(WOLFSSH* ssh, byte* buf, word32 bufSz, if (ret == WS_SUCCESS) { /* replace space with newline for atoi */ buf[spaceIdx] = '\n'; - ssh->scpFileSz = strtol((char *)(buf + idx), buf + spaceIdx, 10); + ssh->scpFileSz = strtol((char *)(buf + idx), NULL, 10); /* restore space, increment idx to space */ buf[spaceIdx] = ' '; @@ -1000,7 +1000,7 @@ static int GetScpTimestamp(WOLFSSH* ssh, byte* buf, word32 bufSz, if (ret == WS_SUCCESS) { /* replace space with newline for atoi */ buf[spaceIdx] = '\n'; - ssh->scpMTime = strtol((char*)(buf + idx), buf + spaceIdx, 10); + ssh->scpMTime = strtol((char*)(buf + idx), NULL, 10); /* restore space, increment idx past it */ buf[spaceIdx] = ' '; @@ -1032,7 +1032,7 @@ static int GetScpTimestamp(WOLFSSH* ssh, byte* buf, word32 bufSz, if (ret == WS_SUCCESS) { /* replace space with newline for atoi */ buf[spaceIdx] = '\n'; - ssh->scpATime = strtol((char*)(buf + idx), buf + spaceIdx, 10); + ssh->scpATime = strtol((char*)(buf + idx), NULL, 10); /* restore space, increment idx past it */ buf[spaceIdx] = ' ';