diff --git a/client/cmddata.c b/client/cmddata.c index ce6a3e8e..a812b793 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -421,7 +421,8 @@ int ASKDemod_ext(const char *Cmd, bool verbose, bool emSearch, uint8_t askType, bool st = false; size_t ststart = 0, stend = 0; - if (*stCheck) st = DetectST(BitStream, &BitLen, &foundclk, &ststart, &stend); + if (*stCheck) + st = DetectST(BitStream, &BitLen, &foundclk, &ststart, &stend); if (st) { *stCheck = st; diff --git a/client/cmdlfem4x.c b/client/cmdlfem4x.c index 9c3cb342..cba5fdd9 100644 --- a/client/cmdlfem4x.c +++ b/client/cmdlfem4x.c @@ -1064,8 +1064,7 @@ bool detectPSK(){ // try manchester - NOTE: ST only applies to T55x7 tags. bool detectASK_MAN(){ bool stcheck = false; - int ans = ASKDemod_ext("0 0 0", false, false, 1, &stcheck); - if (!ans) { + if ( !ASKDemod_ext("0 0 0", false, false, 1, &stcheck) ) { if (g_debugMode) PrintAndLog("DEBUG: Error - EM: ASK/Manchester Demod failed"); return false; } diff --git a/client/cmdlfnoralsy.c b/client/cmdlfnoralsy.c index 3608b464..8811d65e 100644 --- a/client/cmdlfnoralsy.c +++ b/client/cmdlfnoralsy.c @@ -106,7 +106,10 @@ int CmdNoralsyDemod(const char *Cmd) { if (g_debugMode) PrintAndLog("DEBUG: Error - Noralsy: ASK/Manchester Demod failed"); return 0; } - if (!st) return 0; + if (!st) { + if (g_debugMode) PrintAndLog("DEBUG: Error - Noralsy: sequence terminator not found"); + return 0; + } size_t size = DemodBufferLen; int ans = detectNoralsy(DemodBuffer, &size); diff --git a/common/lfdemod.c b/common/lfdemod.c index 35cc4ec2..8e31ea69 100644 --- a/common/lfdemod.c +++ b/common/lfdemod.c @@ -1050,7 +1050,7 @@ bool DetectST(uint8_t buffer[], size_t *size, int *foundclock, size_t *ststart, // now do it again to find the end int dummy1 = 0; end = skip; - i+=3; + i += 3; if (!findST(&dummy1, &end, tmpbuff, waveLen, clk, tol, j, &i)) { //didn't find second ST - ERROR if (g_debugMode==2) prnt("DEBUG STT: second STT not found - quitting");