summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/b_dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bio/b_dump.c')
-rw-r--r--src/lib/libcrypto/bio/b_dump.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/libcrypto/bio/b_dump.c b/src/lib/libcrypto/bio/b_dump.c
index 983604fb49..f671e722fa 100644
--- a/src/lib/libcrypto/bio/b_dump.c
+++ b/src/lib/libcrypto/bio/b_dump.c
@@ -104,41 +104,41 @@ int BIO_dump_indent(BIO *bio, const char *s, int len, int indent)
104 for(i=0;i<rows;i++) 104 for(i=0;i<rows;i++)
105 { 105 {
106 buf[0]='\0'; /* start with empty string */ 106 buf[0]='\0'; /* start with empty string */
107 strlcpy(buf,str,sizeof buf); 107 BUF_strlcpy(buf,str,sizeof buf);
108 snprintf(tmp,sizeof tmp,"%04x - ",i*dump_width); 108 BIO_snprintf(tmp,sizeof tmp,"%04x - ",i*dump_width);
109 strlcat(buf,tmp,sizeof buf); 109 BUF_strlcat(buf,tmp,sizeof buf);
110 for(j=0;j<dump_width;j++) 110 for(j=0;j<dump_width;j++)
111 { 111 {
112 if (((i*dump_width)+j)>=len) 112 if (((i*dump_width)+j)>=len)
113 { 113 {
114 strlcat(buf," ",sizeof buf); 114 BUF_strlcat(buf," ",sizeof buf);
115 } 115 }
116 else 116 else
117 { 117 {
118 ch=((unsigned char)*(s+i*dump_width+j)) & 0xff; 118 ch=((unsigned char)*(s+i*dump_width+j)) & 0xff;
119 snprintf(tmp,sizeof tmp,"%02x%c",ch, 119 BIO_snprintf(tmp,sizeof tmp,"%02x%c",ch,
120 j==7?'-':' '); 120 j==7?'-':' ');
121 strlcat(buf,tmp,sizeof buf); 121 BUF_strlcat(buf,tmp,sizeof buf);
122 } 122 }
123 } 123 }
124 strlcat(buf," ",sizeof buf); 124 BUF_strlcat(buf," ",sizeof buf);
125 for(j=0;j<dump_width;j++) 125 for(j=0;j<dump_width;j++)
126 { 126 {
127 if (((i*dump_width)+j)>=len) 127 if (((i*dump_width)+j)>=len)
128 break; 128 break;
129 ch=((unsigned char)*(s+i*dump_width+j)) & 0xff; 129 ch=((unsigned char)*(s+i*dump_width+j)) & 0xff;
130#ifndef CHARSET_EBCDIC 130#ifndef CHARSET_EBCDIC
131 snprintf(tmp,sizeof tmp,"%c", 131 BIO_snprintf(tmp,sizeof tmp,"%c",
132 ((ch>=' ')&&(ch<='~'))?ch:'.'); 132 ((ch>=' ')&&(ch<='~'))?ch:'.');
133#else 133#else
134 snprintf(tmp,sizeof tmp,"%c", 134 BIO_snprintf(tmp,sizeof tmp,"%c",
135 ((ch>=os_toascii[' '])&&(ch<=os_toascii['~'])) 135 ((ch>=os_toascii[' '])&&(ch<=os_toascii['~']))
136 ? os_toebcdic[ch] 136 ? os_toebcdic[ch]
137 : '.'); 137 : '.');
138#endif 138#endif
139 strlcat(buf,tmp,sizeof buf); 139 BUF_strlcat(buf,tmp,sizeof buf);
140 } 140 }
141 strlcat(buf,"\n",sizeof buf); 141 BUF_strlcat(buf,"\n",sizeof buf);
142 /* if this is the last call then update the ddt_dump thing so that 142 /* if this is the last call then update the ddt_dump thing so that
143 * we will move the selection point in the debug window 143 * we will move the selection point in the debug window
144 */ 144 */
@@ -147,7 +147,7 @@ int BIO_dump_indent(BIO *bio, const char *s, int len, int indent)
147#ifdef TRUNCATE 147#ifdef TRUNCATE
148 if (trunc > 0) 148 if (trunc > 0)
149 { 149 {
150 snprintf(buf,sizeof buf,"%s%04x - <SPACES/NULS>\n",str, 150 BIO_snprintf(buf,sizeof buf,"%s%04x - <SPACES/NULS>\n",str,
151 len+trunc); 151 len+trunc);
152 ret+=BIO_write(bio,(char *)buf,strlen(buf)); 152 ret+=BIO_write(bio,(char *)buf,strlen(buf));
153 } 153 }