mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-15 11:43:14 +08:00
fix: clock can't be zero or negative
This commit is contained in:
parent
a0e061fcd1
commit
528e8fe395
1 changed files with 5 additions and 2 deletions
|
@ -115,10 +115,13 @@ int GetAskClock(const char *str, bool printAns) {
|
||||||
if (st == false) {
|
if (st == false) {
|
||||||
idx = DetectASKClock(bits, size, &clock, 20);
|
idx = DetectASKClock(bits, size, &clock, 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( clock > 0 ) {
|
||||||
setClockGrid(clock, idx);
|
setClockGrid(clock, idx);
|
||||||
|
}
|
||||||
// Only print this message if we're not looping something
|
// Only print this message if we're not looping something
|
||||||
if (printAns || g_debugMode)
|
if (printAns || g_debugMode)
|
||||||
PrintAndLogEx(NORMAL, "Auto-detected clock rate: %d, Best Starting Position: %d", clock, idx);
|
PrintAndLogEx(DEBUG, "Auto-detected clock rate: %d, Best Starting Position: %d", clock, idx);
|
||||||
|
|
||||||
return clock;
|
return clock;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue