From d6cf1c7df01c152c9a80e7cc7a4948c81259f617 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 4 Jun 2012 22:54:25 +0200 Subject: [PATCH] Fixed LIBSSH2_INT64_T_FORMAT macro. Usually a format macro should hold the whole format, otherwise it should be named a prefix. Also fixed usage of this macro in scp.c for a signed var where it was used as prefix for unsigned. --- src/libssh2_priv.h | 4 ++-- src/scp.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libssh2_priv.h b/src/libssh2_priv.h index c670a16..2354562 100644 --- a/src/libssh2_priv.h +++ b/src/libssh2_priv.h @@ -1030,9 +1030,9 @@ void _libssh2_init_if_needed (void); /* define to output the libssh2_int64_t type in a *printf() */ #if defined( __BORLANDC__ ) || defined( _MSC_VER ) || defined( __MINGW32__ ) -#define LIBSSH2_INT64_T_FORMAT "I64" +#define LIBSSH2_INT64_T_FORMAT "I64d" #else -#define LIBSSH2_INT64_T_FORMAT "ll" +#define LIBSSH2_INT64_T_FORMAT "lld" #endif #endif /* LIBSSH2_H */ diff --git a/src/scp.c b/src/scp.c index 6401dac..63d181e 100644 --- a/src/scp.c +++ b/src/scp.c @@ -957,7 +957,7 @@ scp_send(LIBSSH2_SESSION * session, const char *path, int mode, session->scpSend_response_len = snprintf((char *) session->scpSend_response, LIBSSH2_SCP_RESPONSE_BUFLEN, "C0%o %" - LIBSSH2_INT64_T_FORMAT "u %s\n", mode, + LIBSSH2_INT64_T_FORMAT " %s\n", mode, size, base); _libssh2_debug(session, LIBSSH2_TRACE_SCP, "Sent %s", session->scpSend_response);