]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/reveng/reveng.c
FIX: lf hitag : Mea culpa, simulation should not have reader_field on. thanks to...
[proxmark3-svn] / client / reveng / reveng.c
index 5cda62d16d980ffce36915e8d86c2900d442d9ef..8a669e9058fcce217856024705de7387adf90add 100644 (file)
@@ -1,9 +1,9 @@
 /* reveng.c
- * Greg Cook, 9/Apr/2015
+ * Greg Cook, 27/Jun/2016
  */
 
-/* CRC RevEng, an arbitrary-precision CRC calculator and algorithm finder
- * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  Gregory Cook
+/* CRC RevEng: arbitrary-precision CRC calculator and algorithm finder
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016  Gregory Cook
  *
  * This file is part of CRC RevEng.
  *
@@ -18,7 +18,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with CRC RevEng.  If not, see <http://www.gnu.org/licenses/>.
+ * along with CRC RevEng.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 /* 2013-09-16: calini(), calout() work on shortest argument
@@ -473,9 +473,12 @@ chkres(int *resc, model_t **result, const poly_t divisor, const poly_t init, int
        pfree(&xor);
        if(aptr != eptr) return;
 
-       if(!(*result = realloc(*result, ++*resc * sizeof(model_t))))
+       *result = realloc(*result, ++*resc * sizeof(model_t));
+       if (!*result) {
                uerror("cannot reallocate result array");
-
+               return;
+       }
+       
        rptr = *result + *resc - 1;
        rptr->spoly  = pclone(divisor);
        rptr->init   = pclone(init);
Impressum, Datenschutz