]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
Limit hexsamples to just the amount of requested samples
authorhenryk@ploetzli.ch <henryk@ploetzli.ch@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Thu, 3 Dec 2009 16:21:44 +0000 (16:21 +0000)
committerhenryk@ploetzli.ch <henryk@ploetzli.ch@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Thu, 3 Dec 2009 16:21:44 +0000 (16:21 +0000)
winsrc/command.cpp

index 456830749c6e29ced7f6f9899bfc9dc034556961..0214a0ab94af36d895f3c72f145155ffb7b718ea 100644 (file)
@@ -909,9 +909,12 @@ static void CmdHexsamples(char *str)
 {\r
        int i;\r
        int n;\r
 {\r
        int i;\r
        int n;\r
+       int requested = atoi(str);\r
+       int delivered = 0;\r
 \r
        if(atoi(str) == 0) {\r
                n = 12;\r
 \r
        if(atoi(str) == 0) {\r
                n = 12;\r
+               requested = 12;\r
        } else {\r
                n = atoi(str)/4;\r
        }\r
        } else {\r
                n = atoi(str)/4;\r
        }\r
@@ -939,7 +942,12 @@ static void CmdHexsamples(char *str)
                                c.d.asBytes[j+7],\r
                                c.d.asBytes[j+8]\r
                        );\r
                                c.d.asBytes[j+7],\r
                                c.d.asBytes[j+8]\r
                        );\r
+                       delivered += 8;\r
+                       if(delivered >= requested)\r
+                               break;\r
                }\r
                }\r
+               if(delivered >= requested)\r
+                       break;\r
        }\r
 }\r
 \r
        }\r
 }\r
 \r
Impressum, Datenschutz