summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src/crypto/bio/b_dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libssl/src/crypto/bio/b_dump.c')
-rw-r--r--lib/libssl/src/crypto/bio/b_dump.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/libssl/src/crypto/bio/b_dump.c b/lib/libssl/src/crypto/bio/b_dump.c
index db84ad3d478..a7cd8289785 100644
--- a/lib/libssl/src/crypto/bio/b_dump.c
+++ b/lib/libssl/src/crypto/bio/b_dump.c
@@ -62,15 +62,12 @@
#include <stdio.h>
#include "cryptlib.h"
-#include "bio.h"
+#include <openssl/bio.h>
#define TRUNCATE
#define DUMP_WIDTH 16
-int BIO_dump(bio,s,len)
-BIO *bio;
-char *s;
-int len;
+int BIO_dump(BIO *bio, const char *s, int len)
{
int ret=0;
char buf[160+1],tmp[20];
@@ -105,7 +102,13 @@ int len;
if (((i*DUMP_WIDTH)+j)>=len)
break;
ch=((unsigned char)*((char *)(s)+i*DUMP_WIDTH+j)) & 0xff;
+#ifndef CHARSET_EBCDIC
sprintf(tmp,"%c",((ch>=' ')&&(ch<='~'))?ch:'.');
+#else
+ sprintf(tmp,"%c",((ch>=os_toascii[' '])&&(ch<=os_toascii['~']))
+ ? os_toebcdic[ch]
+ : '.');
+#endif
strcat(buf,tmp);
}
strcat(buf,"\n");