summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2023-01-16 23:49:01 +0100
committerHugo Landau <hlandau@openssl.org>2023-01-24 11:03:19 +0000
commit4a6e5a11c72a4f3ec082cc065b44906409ad8fae (patch)
treef83dc58ef5c583409870a9daf1b258a7845d36f2 /apps
parente787c57c538d0922004e49a10be0d403af773272 (diff)
downloadopenssl-new-4a6e5a11c72a4f3ec082cc065b44906409ad8fae.tar.gz
Fix windows builds
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20109)
Diffstat (limited to 'apps')
-rw-r--r--apps/cmp.c2
-rw-r--r--apps/lib/http_server.c18
-rw-r--r--apps/lib/log.c2
3 files changed, 11 insertions, 11 deletions
diff --git a/apps/cmp.c b/apps/cmp.c
index e44d32fd7f..f72a77e3a3 100644
--- a/apps/cmp.c
+++ b/apps/cmp.c
@@ -2048,7 +2048,7 @@ static int save_cert_or_delete(X509 *cert, const char *file, const char *desc)
if (cert == NULL) {
char desc_cert[80];
- snprintf(desc_cert, sizeof(desc_cert), "%s certificate", desc);
+ BIO_snprintf(desc_cert, sizeof(desc_cert), "%s certificate", desc);
return delete_file(file, desc_cert);
} else {
STACK_OF(X509) *certs = sk_X509_new_null();
diff --git a/apps/lib/http_server.c b/apps/lib/http_server.c
index 03afd715be..622c908e52 100644
--- a/apps/lib/http_server.c
+++ b/apps/lib/http_server.c
@@ -506,12 +506,12 @@ int http_server_send_asn1_resp(const char *prog, BIO *cbio, int keep_alive,
const ASN1_ITEM *it, const ASN1_VALUE *resp)
{
char buf[200], *p;
- int ret = snprintf(buf, sizeof(buf), HTTP_1_0" 200 OK\r\n%s"
- "Content-type: %s\r\n"
- "Content-Length: %d\r\n",
- keep_alive ? "Connection: keep-alive\r\n" : "",
- content_type,
- ASN1_item_i2d(resp, NULL, it));
+ int ret = BIO_snprintf(buf, sizeof(buf), HTTP_1_0" 200 OK\r\n%s"
+ "Content-type: %s\r\n"
+ "Content-Length: %d\r\n",
+ keep_alive ? "Connection: keep-alive\r\n" : "",
+ content_type,
+ ASN1_item_i2d(resp, NULL, it));
if (ret < 0 || (size_t)ret >= sizeof(buf))
return 0;
@@ -532,9 +532,9 @@ int http_server_send_status(const char *prog, BIO *cbio,
int status, const char *reason)
{
char buf[200];
- int ret = snprintf(buf, sizeof(buf), HTTP_1_0" %d %s\r\n\r\n",
- /* This implicitly cancels keep-alive */
- status, reason);
+ int ret = BIO_snprintf(buf, sizeof(buf), HTTP_1_0" %d %s\r\n\r\n",
+ /* This implicitly cancels keep-alive */
+ status, reason);
if (ret < 0 || (size_t)ret >= sizeof(buf))
return 0;
diff --git a/apps/lib/log.c b/apps/lib/log.c
index 7cf5ad5f89..b2e356261f 100644
--- a/apps/lib/log.c
+++ b/apps/lib/log.c
@@ -46,7 +46,7 @@ static void log_with_prefix(const char *prog, const char *fmt, va_list ap)
char prefix[80];
BIO *bio, *pre = BIO_new(BIO_f_prefix());
- (void)snprintf(prefix, sizeof(prefix), "%s: ", prog);
+ (void)BIO_snprintf(prefix, sizeof(prefix), "%s: ", prog);
(void)BIO_set_prefix(pre, prefix);
bio = BIO_push(pre, bio_err);
(void)BIO_vprintf(bio, fmt, ap);