- if (indent < 0)
- indent = 0;
- if (indent)
- {
- if (indent > 128) indent=128;
- memset(str,' ',indent);
- }
- str[indent]='\0';
-
- dump_width=DUMP_WIDTH_LESS_INDENT(indent);
- rows=(len/dump_width);
- if ((rows*dump_width)<len)
- rows++;
- for(i=0;i<rows;i++)
- {
- buf[0]='\0'; /* start with empty string */
- BUF_strlcpy(buf,str,sizeof buf);
- BIO_snprintf(tmp,sizeof tmp,"%04x - ",i*dump_width);
- BUF_strlcat(buf,tmp,sizeof buf);
- for(j=0;j<dump_width;j++)
- {
- if (((i*dump_width)+j)>=len)
- {
- BUF_strlcat(buf," ",sizeof buf);
- }
- else
- {
- ch=((unsigned char)*(s+i*dump_width+j)) & 0xff;
- BIO_snprintf(tmp,sizeof tmp,"%02x%c",ch,
- j==7?'-':' ');
- BUF_strlcat(buf,tmp,sizeof buf);
- }
- }
- BUF_strlcat(buf," ",sizeof buf);
- for(j=0;j<dump_width;j++)
- {
- if (((i*dump_width)+j)>=len)
- break;
- ch=((unsigned char)*(s+i*dump_width+j)) & 0xff;
+ if (indent < 0)
+ indent = 0;
+ if (indent) {
+ if (indent > 128)
+ indent = 128;
+ memset(str, ' ', indent);
+ }
+ str[indent] = '\0';
+
+ dump_width = DUMP_WIDTH_LESS_INDENT(indent);
+ rows = (len / dump_width);
+ if ((rows * dump_width) < len)
+ rows++;
+ for (i = 0; i < rows; i++) {
+ buf[0] = '\0'; /* start with empty string */
+ BUF_strlcpy(buf, str, sizeof buf);
+ BIO_snprintf(tmp, sizeof tmp, "%04x - ", i * dump_width);
+ BUF_strlcat(buf, tmp, sizeof buf);
+ for (j = 0; j < dump_width; j++) {
+ if (((i * dump_width) + j) >= len) {
+ BUF_strlcat(buf, " ", sizeof buf);
+ } else {
+ ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
+ BIO_snprintf(tmp, sizeof tmp, "%02x%c", ch,
+ j == 7 ? '-' : ' ');
+ BUF_strlcat(buf, tmp, sizeof buf);
+ }
+ }
+ BUF_strlcat(buf, " ", sizeof buf);
+ for (j = 0; j < dump_width; j++) {
+ if (((i * dump_width) + j) >= len)
+ break;
+ ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;