Skip to content

Commit 40d5909

Browse files
Fix
1 parent e506b82 commit 40d5909

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/wolfscp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,11 @@ static char* MakeScpCmd(const char* name, char dir, void* heap)
19041904
char* cmd;
19051905
int sz;
19061906

1907+
#ifdef USE_WINDOWS_API
1908+
sz = WSCPRINTF("scp -%c %s", dir, name) + 1;
1909+
#else
19071910
sz = WSNPRINTF(NULL, 0, "scp -%c %s", dir, name) + 1;
1911+
#endif
19081912
if (sz <= 0) {
19091913
return NULL;
19101914
}

wolfssh/port.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ extern "C" {
551551
#define WSTRNCASECMP(s1,s2,n) _strnicmp((s1),(s2),(n))
552552
#define WSNPRINTF(s,n,f,...) _snprintf_s((s),(n),_TRUNCATE,(f),##__VA_ARGS__)
553553
#define WVSNPRINTF(s,n,f,...) _vsnprintf_s((s),(n),_TRUNCATE,(f),##__VA_ARGS__)
554+
#define WSCPRINTF(f,...) _scprintf((f),##__VA_ARGS__)
554555
#define WSTRTOK(s1,s2,s3) strtok_s((s1),(s2),(s3))
555556
#elif defined(MICROCHIP_MPLAB_HARMONY) || defined(MICROCHIP_PIC32)
556557
#include <stdio.h>

0 commit comments

Comments
 (0)