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. Signed-off-by: Michael Holzheu <holzheu@xxxxxxxxxxxxxxxxxx> --- 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:
s390dbf: Print only ASCII characters in hex_ascii view From: Michael Holzheu <holzheu@xxxxxxxxxxxxxxxxxx> 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 print only ASCII characters. This patch adds this modification. Signed-off-by: Michael Holzheu <holzheu@xxxxxxxxxxxxxxxxxx> --- 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@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/crash-utility