- if (((i * dump_width) + j) >= len) {
- strcat(buf, " ");
- } else {
- ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
- sprintf(tmp, "%02x%c", ch, j == 7 ? '-' : ' ');
- strcat(buf, tmp);
+ if (SPACE(buf, n, 3)) {
+ if (((i * dump_width) + j) >= len) {
+ strcpy(buf + n, " ");
+ } else {
+ ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
+ BIO_snprintf(buf + n, 4, "%02x%c", ch,
+ j == 7 ? '-' : ' ');
+ }
+ n += 3;