mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-19 19:38:52 +08:00
fix: remove compile warnings (@winguru)
This commit is contained in:
parent
4bfc3ca8c9
commit
9e527537c6
1 changed files with 9 additions and 7 deletions
|
@ -135,22 +135,24 @@ void Dbhexdump(int len, uint8_t *d, bool bAsci) {
|
||||||
int l=0, i;
|
int l=0, i;
|
||||||
char ascii[9];
|
char ascii[9];
|
||||||
|
|
||||||
while (len>0) {
|
while (len > 0) {
|
||||||
|
|
||||||
l = (len>8) ? 8 : len;
|
l = (len>8) ? 8 : len;
|
||||||
|
|
||||||
memcpy(ascii,d,l);
|
memcpy(ascii, d, l);
|
||||||
ascii[l]=0;
|
ascii[l]=0;
|
||||||
|
|
||||||
// filter safe ascii
|
// filter safe ascii
|
||||||
for (i=0; i<l; i++)
|
for (i=0; i<l; i++) {
|
||||||
if (ascii[i] < 32 || ascii[i] > 126)
|
if (ascii[i] < 32 || ascii[i] > 126) {
|
||||||
ascii[i] = '.';
|
ascii[i] = '.';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (bAsci)
|
if (bAsci)
|
||||||
Dbprintf("%-8s %*D",ascii,l,d," ");
|
Dbprintf("%-8s %*D", ascii, l, d, " ");
|
||||||
else
|
else
|
||||||
Dbprintf("%*D",l,d," ");
|
Dbprintf("%*D", l, d, " ");
|
||||||
|
|
||||||
len -= 8;
|
len -= 8;
|
||||||
d += 8;
|
d += 8;
|
||||||
|
|
Loading…
Add table
Reference in a new issue