| 579 | } |
| 580 | |
| 581 | void str_hex(char *dst, int dst_size, const void *data, int data_size) |
| 582 | { |
| 583 | static const char hex[] = "0123456789ABCDEF"; |
| 584 | int data_index; |
| 585 | int dst_index; |
| 586 | for(data_index = 0, dst_index = 0; data_index < data_size && dst_index < dst_size - 3; data_index++) |
| 587 | { |
| 588 | dst[data_index * 3] = hex[((const unsigned char *)data)[data_index] >> 4]; |
| 589 | dst[data_index * 3 + 1] = hex[((const unsigned char *)data)[data_index] & 0xf]; |
| 590 | dst[data_index * 3 + 2] = ' '; |
| 591 | dst_index += 3; |
| 592 | } |
| 593 | dst[dst_index] = '\0'; |
| 594 | } |
| 595 | |
| 596 | void str_hex_cstyle(char *dst, int dst_size, const void *data, int data_size, int bytes_per_line) |
| 597 | { |
no outgoing calls