aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gtls.c2
-rw-r--r--lib/nss.c2
-rw-r--r--lib/ssluse.c8
-rw-r--r--lib/version.c12
4 files changed, 15 insertions, 9 deletions
diff --git a/lib/gtls.c b/lib/gtls.c
index a40ea096b..834994069 100644
--- a/lib/gtls.c
+++ b/lib/gtls.c
@@ -691,7 +691,7 @@ void Curl_gtls_session_free(void *ptr)
size_t Curl_gtls_version(char *buffer, size_t size)
{
- return snprintf(buffer, size, " GnuTLS/%s", gnutls_check_version(NULL));
+ return snprintf(buffer, size, "GnuTLS/%s", gnutls_check_version(NULL));
}
#endif /* USE_GNUTLS */
diff --git a/lib/nss.c b/lib/nss.c
index e90156e15..b61308309 100644
--- a/lib/nss.c
+++ b/lib/nss.c
@@ -601,6 +601,6 @@ ssize_t Curl_nss_recv(struct connectdata * conn, /* connection data */
size_t Curl_nss_version(char *buffer, size_t size)
{
- return snprintf(buffer, size, " NSS/%s", NSS_VERSION);
+ return snprintf(buffer, size, "NSS/%s", NSS_VERSION);
}
#endif /* USE_NSS */
diff --git a/lib/ssluse.c b/lib/ssluse.c
index d15cd71a1..acaf9612d 100644
--- a/lib/ssluse.c
+++ b/lib/ssluse.c
@@ -1898,7 +1898,7 @@ size_t Curl_ossl_version(char *buffer, size_t size)
#ifdef YASSL_VERSION
/* yassl provides an OpenSSL API compatiblity layer so it looks identical
to OpenSSL in all other aspects */
- return snprintf(buffer, size, " yassl/%s", YASSL_VERSION);
+ return snprintf(buffer, size, "yassl/%s", YASSL_VERSION);
#else /* YASSL_VERSION */
#if (SSLEAY_VERSION_NUMBER >= 0x905000)
@@ -1919,7 +1919,7 @@ size_t Curl_ossl_version(char *buffer, size_t size)
sub[0]='\0';
}
- return snprintf(buffer, size, " OpenSSL/%lx.%lx.%lx%s",
+ return snprintf(buffer, size, "OpenSSL/%lx.%lx.%lx%s",
(ssleay_value>>28)&0xf,
(ssleay_value>>20)&0xff,
(ssleay_value>>12)&0xff,
@@ -1929,7 +1929,7 @@ size_t Curl_ossl_version(char *buffer, size_t size)
#else /* SSLEAY_VERSION_NUMBER is less than 0.9.5 */
#if (SSLEAY_VERSION_NUMBER >= 0x900000)
- return snprintf(buffer, size, " OpenSSL/%lx.%lx.%lx",
+ return snprintf(buffer, size, "OpenSSL/%lx.%lx.%lx",
(SSLEAY_VERSION_NUMBER>>28)&0xff,
(SSLEAY_VERSION_NUMBER>>20)&0xff,
(SSLEAY_VERSION_NUMBER>>12)&0xf);
@@ -1944,7 +1944,7 @@ size_t Curl_ossl_version(char *buffer, size_t size)
else
sub[0]='\0';
- return snprintf(buffer, size, " SSL/%x.%x.%x%s",
+ return snprintf(buffer, size, "SSL/%x.%x.%x%s",
(SSLEAY_VERSION_NUMBER>>12)&0xff,
(SSLEAY_VERSION_NUMBER>>8)&0xf,
(SSLEAY_VERSION_NUMBER>>4)&0xf, sub);
diff --git a/lib/version.c b/lib/version.c
index de803babb..24f5c622b 100644
--- a/lib/version.c
+++ b/lib/version.c
@@ -61,9 +61,15 @@ char *curl_version(void)
left -= len;
ptr += len;
- len = Curl_ssl_version(ptr, left);
- left -= len;
- ptr += len;
+ if (left > 1) {
+ len = Curl_ssl_version(ptr + 1, left - 1);
+
+ if (len > 0) {
+ *ptr = ' ';
+ left -= ++len;
+ ptr += len;
+ }
+ }
#ifdef HAVE_LIBZ
len = snprintf(ptr, left, " zlib/%s", zlibVersion());