From a864fc839698cbba24f03b581fcf204be9ef19e4 Mon Sep 17 00:00:00 2001 From: Martin Troxler Date: Mon, 30 Nov 2009 12:26:24 +0100 Subject: [PATCH] ec_print_data: show only the first 128 and the last 128 bytes of a data block --- master/module.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/master/module.c b/master/module.c index d9a07375..5e8c8af4 100644 --- a/master/module.c +++ b/master/module.c @@ -318,6 +318,8 @@ static int ec_mac_parse(uint8_t *mac, const char *src, int allow_empty) /*****************************************************************************/ /** Outputs frame contents for debugging purposes. + * If the data block is larger than 256 bytes, only the first 128 + * and the last 128 bytes will be shown */ void ec_print_data(const uint8_t *data, /**< pointer to data */ size_t size /**< number of bytes to output */ @@ -332,10 +334,11 @@ void ec_print_data(const uint8_t *data, /**< pointer to data */ printk("\n"); EC_DBG(""); } - if (i == 128 && size > 256) + if (i+1 == 128 && size > 256) { - EC_DBG("dropped %d bytes\n",size-128-i); + printk("dropped %d bytes\n",size-128-i); i = size - 128; + EC_DBG(""); } } printk("\n");