minor adjustements, found some comments.

This commit is contained in:
iceman1001 2016-04-05 04:45:07 +02:00
commit 13629a71d3

View file

@ -19,8 +19,6 @@
#include <stdio.h>
#include <string.h>
//#include <stdlib.h>
//#include <ctype.h>
#include "cmdmain.h"
#include "cmdcrc.h"
#include "reveng/reveng.h"
@ -77,7 +75,7 @@ int CmdCrc(const char *Cmd)
reveng_main(argc, argv);
}
//PrintAndLog("DEBUG argc: %d, %s %s Cmd: %s",argc, argv[0], Cmd2, Cmd);
for(int i = 0; i < argc; ++i){
for(int i = 0; i < argc; ++i) {
free(argv[i]);
}
@ -137,6 +135,7 @@ int GetModels(char *Models[], int *count, uint8_t *width){
praloc(&model.spoly, (unsigned long)width[0]);
praloc(&model.init, (unsigned long)width[0]);
praloc(&model.xorout, (unsigned long)width[0]);
if(!plen(model.spoly))
palloc(&model.spoly, (unsigned long)width[0]);
else
@ -318,9 +317,13 @@ int RunModel(char *inModel, char *inHexStr, bool reverse, char endian, char *res
model.flags &= ~P_RTJUST;
break;
}
/* canonicalise the model, so the one we dump is the one we
* calculate with (not with -s, spoly may be blank which will
* normalise to zero and clear init and xorout.)
*/
mcanon(&model);
if (reverse) {
// v calculate reversed CRC
/* Distinct from the -V switch as this causes