X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/180ec86ef0c5a005b7a677b6da3d98b8b127782f..d0724780ab600fd4c8e4b3a7dc43a9a01a3e8fb8:/client/cmddata.c diff --git a/client/cmddata.c b/client/cmddata.c index 40884a14..18edd33e 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -76,7 +76,7 @@ void printDemodBuff(void) } if (bitLen>512) bitLen=512; //max output to 512 bits if we have more - should be plenty - char *bin = sprint_bin_break(DemodBuffer,bitLen,16); + char *bin = sprint_bin_break(DemodBuffer, bitLen,16); PrintAndLog("%s",bin); return; @@ -527,7 +527,11 @@ int ASKbiphaseDemod(const char *Cmd, bool verbose) sscanf(Cmd, "%i %i %i %i", &offset, &clk, &invert, &maxErr); uint8_t BitStream[MAX_DEMOD_BUF_LEN]; - size_t size = getFromGraphBuf(BitStream); + size_t size = getFromGraphBuf(BitStream); + if (size == 0 ) { + if (g_debugMode) PrintAndLog("DEBUG: no data in graphbuf"); + return 0; + } //invert here inverts the ask raw demoded bits which has no effect on the demod, but we need the pointer int errCnt = askdemod(BitStream, &size, &clk, &invert, maxErr, 0, 0); if ( errCnt < 0 || errCnt > maxErr ) {