summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorArmin Fuerst <armin@fuerst.priv.at>2021-03-06 12:19:18 +0100
committerTomas Mraz <tomas@openssl.org>2021-04-09 16:20:47 +0200
commitb1c908f421b3466aecf980603132bcab89d1ce99 (patch)
tree8135f20bcef0a308178bc4e69003ec4e699a2835 /apps
parentd3a5898a7f4980bc0fa6345c408f88007573c405 (diff)
downloadopenssl-new-b1c908f421b3466aecf980603132bcab89d1ce99.tar.gz
apps: fix warning about size_t / int conversion
Windows builds show the following warning: (..\apps\ca.c(2643): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data) Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14453)
Diffstat (limited to 'apps')
-rw-r--r--apps/include/apps.h2
-rw-r--r--apps/lib/apps.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/apps/include/apps.h b/apps/include/apps.h
index a2826e6066..96b37ef95c 100644
--- a/apps/include/apps.h
+++ b/apps/include/apps.h
@@ -212,7 +212,7 @@ typedef struct ca_db_st {
} CA_DB;
void app_bail_out(char *fmt, ...);
-void* app_malloc(int sz, const char *what);
+void *app_malloc(size_t sz, const char *what);
BIGNUM *load_serial(const char *serialfile, int create, ASN1_INTEGER **retai);
int save_serial(const char *serialfile, const char *suffix, const BIGNUM *serial,
ASN1_INTEGER **retai);
diff --git a/apps/lib/apps.c b/apps/lib/apps.c
index 69a98ecf37..df4edfb837 100644
--- a/apps/lib/apps.c
+++ b/apps/lib/apps.c
@@ -628,12 +628,12 @@ void app_bail_out(char *fmt, ...)
exit(1);
}
-void* app_malloc(int sz, const char *what)
+void *app_malloc(size_t sz, const char *what)
{
void *vp = OPENSSL_malloc(sz);
if (vp == NULL)
- app_bail_out("%s: Could not allocate %d bytes for %s\n",
+ app_bail_out("%s: Could not allocate %zu bytes for %s\n",
opt_getprog(), sz, what);
return vp;
}