mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 22:03:42 -07:00
Merge pull request #1693 from Doridian/fix/x_to_buffer2
Partial revert of previous change, hex_max_len is bytes
This commit is contained in:
commit
a919886826
1 changed files with 1 additions and 2 deletions
|
@ -187,11 +187,10 @@ void hex_to_buffer(uint8_t *buf, const uint8_t *hex_data, const size_t hex_len,
|
|||
char *tmp = tmp_base;
|
||||
|
||||
size_t max_len = (hex_len > hex_max_len) ? hex_max_len : hex_len;
|
||||
size_t str_max_len = hex_max_len * (2 + spaces_between);
|
||||
|
||||
size_t i;
|
||||
for (i = 0; i < max_len; ++i, tmp += 2 + spaces_between) {
|
||||
snprintf(tmp, str_max_len - (tmp - tmp_base), (uppercase) ? "%02X" : "%02x", (unsigned int) hex_data[i]);
|
||||
snprintf(tmp, hex_max_len - (tmp - tmp_base), (uppercase) ? "%02X" : "%02x", (unsigned int) hex_data[i]);
|
||||
|
||||
for (size_t j = 0; j < spaces_between; j++)
|
||||
*(tmp + 2 + j) = ' ';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue