]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/graph.c
Add flasher from SVN r623 for HID bootprom and current Mac OS X kext
[proxmark3-svn] / client / graph.c
index 269c2dd98cb8696b149db0d297c3f0b9be81c06c..95050f558c169078e96a4d7aaad1a91e7419869b 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){
@@ -76,6 +76,8 @@ size_t getFromGraphBuf(uint8_t *buff)
   }
   return i;
 }
+
+
 // Get or auto-detect clock rate
 int GetClock(const char *str, int peak, int verbose)
 {
@@ -89,7 +91,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 +148,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){
@@ -153,4 +159,4 @@ int GetNRZpskClock(const char *str, int peak, int verbose)
                }
        }
        return clock;
-}
\ No newline at end of file
+}
Impressum, Datenschutz