Fix s_client so that it builds on Windows
authorMatt Caswell <matt@openssl.org>
Tue, 22 Jan 2019 14:27:25 +0000 (14:27 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 24 Jan 2019 13:54:52 +0000 (13:54 +0000)
Fixes #8050

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8065)

apps/s_client.c

index d788b89dee13f0bf836b7c70de519f70b4bdacfa..9705c4c56eb441d391939103bdf1f16bbb4dbe1e 100644 (file)
@@ -2360,9 +2360,11 @@ int s_client_main(int argc, char **argv)
                 if (proxypass != NULL)
                     l += strlen(proxypass);
                 proxyauth = app_malloc(l + 2, "Proxy auth string");
-                snprintf(proxyauth, l + 2, "%s:%s", proxyuser, (proxypass != NULL) ? proxypass : "");
+                BIO_snprintf(proxyauth, l + 2, "%s:%s", proxyuser,
+                             (proxypass != NULL) ? proxypass : "");
                 proxyauthenc = base64encode(proxyauth, strlen(proxyauth));
-                BIO_printf(fbio, "Proxy-Authorization: Basic %s\r\n", proxyauthenc); 
+                BIO_printf(fbio, "Proxy-Authorization: Basic %s\r\n",
+                           proxyauthenc);
                 OPENSSL_clear_free(proxyauth, strlen(proxyauth));
                 OPENSSL_clear_free(proxyauthenc, strlen(proxyauthenc));
             }