[Crash-utility] [PATCH] s390dbf: Print only ASCII characters in hex_ascii view

Dave Anderson anderson at redhat.com
Tue Feb 14 14:20:32 UTC 2012



----- Original Message -----
> Hi Dave,
> 
> Currently the hex_ascii view displays also non ASCII characters.
> Example:
> 
> $ s390dbf test hex_ascii
> 00 01328703733:110640 1 - 01 0000000000114288  fb 63 ff fb fc | �c���
> 
> To make the output better readable we should only print ASCII
> characters.

Queued for crash-6.0.4.

Thanks, 
 Dave

> 
> Signed-off-by: Michael Holzheu <holzheu at linux.vnet.ibm.com>
> ---
>  s390dbf.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> --- a/s390dbf.c
> +++ b/s390dbf.c
> @@ -419,10 +419,10 @@ hex_ascii_format_fn(debug_info_t * id, d
>  	rc += sprintf(out_buf + rc, "| ");
>  	for (i = 0; i < id->buf_size; i++) {
>  		unsigned char c = in_buf[i];
> -		if (!isprint(c))
> -			rc += sprintf(out_buf + rc, ".");
> -		else
> +		if (isascii(c) && isprint(c))
>  			rc += sprintf(out_buf + rc, "%c", c);
> +		else
> +			rc += sprintf(out_buf + rc, ".");
>  	}
>  	rc += sprintf(out_buf + rc, "\n");
>        out:
> 
> 
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
> 




More information about the Crash-utility mailing list