mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-09-21 15:56:21 +08:00
Limit hexsamples to just the amount of requested samples
This commit is contained in:
parent
68d9d60a4d
commit
78d647da02
|
@ -909,9 +909,12 @@ static void CmdHexsamples(char *str)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int n;
|
int n;
|
||||||
|
int requested = atoi(str);
|
||||||
|
int delivered = 0;
|
||||||
|
|
||||||
if(atoi(str) == 0) {
|
if(atoi(str) == 0) {
|
||||||
n = 12;
|
n = 12;
|
||||||
|
requested = 12;
|
||||||
} else {
|
} else {
|
||||||
n = atoi(str)/4;
|
n = atoi(str)/4;
|
||||||
}
|
}
|
||||||
|
@ -939,7 +942,12 @@ static void CmdHexsamples(char *str)
|
||||||
c.d.asBytes[j+7],
|
c.d.asBytes[j+7],
|
||||||
c.d.asBytes[j+8]
|
c.d.asBytes[j+8]
|
||||||
);
|
);
|
||||||
|
delivered += 8;
|
||||||
|
if(delivered >= requested)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
if(delivered >= requested)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue