summaryrefslogtreecommitdiffstats
path: root/super-ddf.c
diff options
context:
space:
mode:
authormwilck@arcor.de <mwilck@arcor.de>2013-07-08 23:50:46 +0200
committerNeilBrown <neilb@suse.de>2013-07-10 02:42:17 +0200
commit4a03cbd10b4444710a52824476a71994632e0237 (patch)
tree788fbf64333e56809dd1d1c895b0dd0ab263bb84 /super-ddf.c
parentDDF: ddf_process_update: add debug messages fore adding VDs (diff)
downloadmdadm-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.c9
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;
}