mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-19 21:03:23 -07:00
Fixed issue where -1 size_t was returned
This commit is contained in:
parent
afceaf4018
commit
e629181f5a
1 changed files with 6 additions and 2 deletions
|
@ -66,7 +66,7 @@ void setGraphBuf(uint8_t *buff, size_t size)
|
||||||
}
|
}
|
||||||
size_t getFromGraphBuf(uint8_t *buff)
|
size_t getFromGraphBuf(uint8_t *buff)
|
||||||
{
|
{
|
||||||
if ( buff == NULL ) return -1;
|
if ( buff == NULL ) return 0;
|
||||||
|
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
for (i=0;i<GraphTraceLen;++i){
|
for (i=0;i<GraphTraceLen;++i){
|
||||||
|
@ -89,7 +89,7 @@ int GetClock(const char *str, int peak, int verbose)
|
||||||
{
|
{
|
||||||
uint8_t grph[MAX_GRAPH_TRACE_LEN]={0};
|
uint8_t grph[MAX_GRAPH_TRACE_LEN]={0};
|
||||||
size_t size = getFromGraphBuf(grph);
|
size_t size = getFromGraphBuf(grph);
|
||||||
if ( size < 0 ) {
|
if ( size == 0 ) {
|
||||||
PrintAndLog("Failed to copy from graphbuffer");
|
PrintAndLog("Failed to copy from graphbuffer");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -146,6 +146,10 @@ int GetNRZpskClock(const char *str, int peak, int verbose)
|
||||||
{
|
{
|
||||||
uint8_t grph[MAX_GRAPH_TRACE_LEN]={0};
|
uint8_t grph[MAX_GRAPH_TRACE_LEN]={0};
|
||||||
size_t size = getFromGraphBuf(grph);
|
size_t size = getFromGraphBuf(grph);
|
||||||
|
if ( size == 0 ) {
|
||||||
|
PrintAndLog("Failed to copy from graphbuffer");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
clock = DetectpskNRZClock(grph,size,0);
|
clock = DetectpskNRZClock(grph,size,0);
|
||||||
// Only print this message if we're not looping something
|
// Only print this message if we're not looping something
|
||||||
if (!verbose){
|
if (!verbose){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue