lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 07 Mar 2015 18:22:05 -0800
From:	Joe Perches <joe@...ches.com>
To:	Adrian Remonda <adrianremonda@...il.com>
Cc:	broonie@...nel.org, corbet@....net, linux-spi@...r.kernel.org,
	linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] Cleaned hexadecimal dump

On Sat, 2015-03-07 at 12:56 -0500, Adrian Remonda wrote:
> Signed-off-by: Adrian Remonda <adrianremonda@...il.com>
[]
> diff --git a/Documentation/spi/spidev_test.c b/Documentation/spi/spidev_test.c
[]
> +static void hexDump(const void *src, size_t length, size_t bLine, char *prefix)
> +{

Is there something necessary that print_hex_dump can't do?

> +	int i = 0;
> +	char *address = (char *)src;
> +	char *line = (char *)address;
> +	unsigned char c;
> +
> +	printf("%s | ", prefix);
> +	while (length-- > 0) {
> +		printf("%02X ", (unsigned char)*address++);
> +		if (!(++i % bLine) || (length == 0 && i % bLine)) {
> +			if (length == 0) {
> +				while (i++ % bLine)
> +					printf("__ ");
> +			}
> +			printf(" | ");  /* right close */
> +			while (line < address) {
> +				c = *line++;
> +				printf("%c", (c < 33 || c == 255) ? 0x2E : c);
> +			}
> +			printf("\n");
> +			if (length > 0)
> +				printf("%s | ", prefix);
> +		}
> +	}
> +}



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ