diff options
author | mwilck@arcor.de <mwilck@arcor.de> | 2013-07-08 23:50:46 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-07-10 02:42:17 +0200 |
commit | 4a03cbd10b4444710a52824476a71994632e0237 (patch) | |
tree | 788fbf64333e56809dd1d1c895b0dd0ab263bb84 /super-ddf.c | |
parent | DDF: ddf_process_update: add debug messages fore adding VDs (diff) | |
download | mdadm-4a03cbd10b4444710a52824476a71994632e0237.tar.xz mdadm-4a03cbd10b4444710a52824476a71994632e0237.zip |
DDF: guid_str: more readable output
Print ASCII characters as ASCII
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r-- | super-ddf.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/super-ddf.c b/super-ddf.c index 1cb0a9fe..428e8f3b 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -1301,8 +1301,13 @@ static const char *guid_str(const char *guid) static char buf[DDF_GUID_LEN*2+1]; int i; char *p = buf; - for (i = 0; i < DDF_GUID_LEN; i++) - p += sprintf(p, "%02x", (unsigned char)guid[i]); + for (i = 0; i < DDF_GUID_LEN; i++) { + unsigned char c = guid[i]; + if (c >= 32 && c < 127) + p += sprintf(p, "%c", c); + else + p += sprintf(p, "%02x", c); + } *p = '\0'; return (const char *) buf; } |