diff options
author | Richard Godbee <richard@godbee.net> | 2014-09-21 02:14:11 -0400 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2015-03-10 12:32:39 +0100 |
commit | 460e920d8a274e27aab36346eeda6685a42c3314 (patch) | |
tree | 7912657df97d3834fb5d671df45748169a51de8f /crypto/bio | |
parent | e1b568dd2462f7cacf98f3d117936c34e2849a6b (diff) |
BIO_debug_callback: Fix output on 64-bit machines
BIO_debug_callback() no longer assumes the hexadecimal representation of
a pointer fits in 8 characters.
Signed-off-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/bio_cb.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crypto/bio/bio_cb.c b/crypto/bio/bio_cb.c index 3607375642..dcb428b351 100644 --- a/crypto/bio/bio_cb.c +++ b/crypto/bio/bio_cb.c @@ -70,14 +70,17 @@ long BIO_debug_callback(BIO *bio, int cmd, const char *argp, char buf[256]; char *p; long r = 1; + int len; size_t p_maxlen; if (BIO_CB_RETURN & cmd) r = ret; - BIO_snprintf(buf, sizeof buf, "BIO[%08lX]:", (unsigned long)bio); - p = &(buf[14]); - p_maxlen = sizeof buf - 14; + len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio); + + p = buf + len; + p_maxlen = sizeof(buf) - len; + switch (cmd) { case BIO_CB_FREE: BIO_snprintf(p, p_maxlen, "Free - %s\n", bio->method->name); |