]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Fixed issue where -1 size_t was returned
authorMartin Holst Swende <martin@swende.se>
Thu, 22 Jan 2015 20:04:16 +0000 (21:04 +0100)
committerMartin Holst Swende <martin@swende.se>
Thu, 22 Jan 2015 20:04:16 +0000 (21:04 +0100)
client/graph.c

index 269c2dd98cb8696b149db0d297c3f0b9be81c06c..94d6054fe7500653d0b47da3379030dbb4efe612 100644 (file)
@@ -66,7 +66,7 @@ void setGraphBuf(uint8_t *buff, size_t size)
 }
 size_t getFromGraphBuf(uint8_t *buff)
 {
-       if ( buff == NULL ) return -1;
+       if ( buff == NULL ) return 0;
        
   uint32_t 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};
                size_t size = getFromGraphBuf(grph);
-               if ( size < 0 ) {
+               if ( size == 0 ) {
                        PrintAndLog("Failed to copy from graphbuffer");
                        return -1;
                }
@@ -146,6 +146,10 @@ int GetNRZpskClock(const char *str, int peak, int verbose)
        {
                uint8_t grph[MAX_GRAPH_TRACE_LEN]={0};
                size_t size = getFromGraphBuf(grph);
+               if ( size == 0 ) {
+                       PrintAndLog("Failed to copy from graphbuffer");
+                       return -1;
+               }
                clock = DetectpskNRZClock(grph,size,0);
                // Only print this message if we're not looping something
                if (!verbose){
Impressum, Datenschutz