mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-20 21:33:19 -07:00
fix sprint_bin bug i made :(
This commit is contained in:
parent
6bfac25573
commit
7bc6fac3ce
1 changed files with 6 additions and 1 deletions
|
@ -126,7 +126,12 @@ char *sprint_hex(const uint8_t *data, const size_t len) {
|
||||||
|
|
||||||
char *sprint_bin_break(const uint8_t *data, const size_t len, const uint8_t breaks) {
|
char *sprint_bin_break(const uint8_t *data, const size_t len, const uint8_t breaks) {
|
||||||
// make sure we don't go beyond our char array memory
|
// make sure we don't go beyond our char array memory
|
||||||
int max_len = ( len+(len/breaks) > MAX_BIN_BREAK_LENGTH ) ? MAX_BIN_BREAK_LENGTH : len+(len/breaks);
|
int max_len;
|
||||||
|
if (breaks==0)
|
||||||
|
max_len = ( len > MAX_BIN_BREAK_LENGTH ) ? MAX_BIN_BREAK_LENGTH : len;
|
||||||
|
else
|
||||||
|
max_len = ( len+(len/breaks) > MAX_BIN_BREAK_LENGTH ) ? MAX_BIN_BREAK_LENGTH : len+(len/breaks);
|
||||||
|
|
||||||
static char buf[MAX_BIN_BREAK_LENGTH]; // 3072 + end of line characters if broken at 8 bits
|
static char buf[MAX_BIN_BREAK_LENGTH]; // 3072 + end of line characters if broken at 8 bits
|
||||||
//clear memory
|
//clear memory
|
||||||
memset(buf, 0x00, sizeof(buf));
|
memset(buf, 0x00, sizeof(buf));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue