summaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/util.c b/util.c
index b65d2ad..653796f 100644
--- a/util.c
+++ b/util.c
@@ -269,7 +269,7 @@ void copy_uuid(void *a, int b[4], int swapuuid)
memcpy(a, b, 16);
}
-char *fname_from_uuid(struct supertype *st, struct mdinfo *info, char *buf)
+char *fname_from_uuid(struct supertype *st, struct mdinfo *info, char *buf, char sep)
{
int i;
char uuid[16];
@@ -278,10 +278,8 @@ char *fname_from_uuid(struct supertype *st, struct mdinfo *info, char *buf)
c += strlen(c);
copy_uuid(uuid, info->uuid, st->ss->swapuuid);
for (i=0; i<16; i++) {
- if (i && (i&3)==0) {
- strcpy(c, "-");
- c++;
- }
+ if (i && (i&3)==0)
+ *c++ = sep;
sprintf(c,"%02x", (unsigned char)uuid[i]);
c+= 2;
}