diff options
author | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2007-12-14 23:13:20 +0000 |
---|---|---|
committer | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2007-12-14 23:13:20 +0000 |
commit | 5a29168eaddaaa47909f2ae84c41d0743996215f (patch) | |
tree | 2767987f0ce4fabcaf3670e232fa81c86a934d81 /openpicc/application/main.c | |
parent | e777e32afb32f8863d495eff68ea0a91b0793fac (diff) |
Sanitize and clarify the len handling in rx buffers.
Fix miller decoder
git-svn-id: https://svn.openpcd.org:2342/trunk@387 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/main.c')
-rw-r--r-- | openpicc/application/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openpicc/application/main.c b/openpicc/application/main.c index a093d70..19407e6 100644 --- a/openpicc/application/main.c +++ b/openpicc/application/main.c @@ -90,7 +90,7 @@ void main_help_print_buffer(ssc_dma_rx_buffer_t *buffer, int *pktcount) ISO14443A_SHORT_TYPE *tmp = (ISO14443A_SHORT_TYPE*)buffer->data; int i, dumped = 0; unsigned int j; - for(i = buffer->len / sizeof(*tmp); i >= 0 ; i--) { + for(i = buffer->len / (sizeof(*tmp)*8); i >= 0 ; i--) { if( *tmp != 0x00000000 ) { if(dumped == 0) { DumpUIntToUSB(buffer->len); @@ -101,7 +101,7 @@ void main_help_print_buffer(ssc_dma_rx_buffer_t *buffer, int *pktcount) DumpStringToUSB(" "); } dumped = 1; - DumpUIntToUSB(buffer->len / sizeof(*tmp) - i); + DumpUIntToUSB(buffer->len / (sizeof(*tmp)*8) - i); DumpStringToUSB(": "); for(j=0; j<sizeof(*tmp)*8; j++) { usb_print_char_f( (((*tmp) >> j) & 0x1) ? '1' : '_' , 0); |