]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Merge branch 'master' of https://github.com/Proxmark/proxmark3
authoriceman1001 <iceman@iuse.se>
Fri, 30 Jan 2015 14:22:01 +0000 (15:22 +0100)
committericeman1001 <iceman@iuse.se>
Fri, 30 Jan 2015 14:22:01 +0000 (15:22 +0100)
Conflicts:
client/cmddata.c

1  2 
client/cmddata.c

diff --combined client/cmddata.c
index 51402b652885fbebd49b2c6b93d4780b5dd7f72b,25d752f6a47eacf28a7ca827011a2e6aee31de26..533caeb5bf7eee9bc6a7cf66fecb73c473ded17c
@@@ -30,12 -30,6 +30,12 @@@ static int CmdHelp(const char *Cmd)
  //by marshmellow
  void setDemodBuf(uint8_t *buff, size_t size, size_t startIdx)
  {
 +      if (buff == NULL) 
 +              return;
 +      
 +      if ( size >= MAX_DEMOD_BUF_LEN)
 +              size = MAX_DEMOD_BUF_LEN;
 +      
        size_t i = 0;
        for (; i < size; i++){
                DemodBuffer[i]=buff[startIdx++];
@@@ -63,10 -57,8 +63,8 @@@ void printDemodBuff(
        }
        if (bitLen>512) bitLen=512; //max output to 512 bits if we have more - should be plenty
                
-       // equally divided by 16
-       
-       if ( bitLen % 16 > 0)
-               bitLen = (bitLen/16)*16;
+       // ensure equally divided by 16
+       bitLen &= 0xfff0;
        
        for (i = 0; i <= (bitLen-16); i+=16) {
                PrintAndLog("%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i",
@@@ -200,6 -192,11 +198,11 @@@ void printBitStream(uint8_t BitStream[]
      return;
    }
    if (bitLen>512) bitLen=512;
+   
+       // ensure equally divided by 16
+       bitLen &= 0xfff0;
     for (i = 0; i <= (bitLen-16); i+=16) {
      PrintAndLog("%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i",
        BitStream[i],
Impressum, Datenschutz