From ef70b9f4ef7a3a9f70b3a09b3a55b1cc675c0a37 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 8 Nov 2008 16:03:07 -0700 Subject: [PATCH] fix remove_devices() Don't write to 'pe' if 'path' was not specified Signed-off-by: Dan Williams --- Manage.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Manage.c b/Manage.c index 9424650..ccc13c4 100644 --- a/Manage.c +++ b/Manage.c @@ -150,10 +150,12 @@ static void remove_devices(int devnum, char *path) for (part = 0; part < 16; part++) { if (part) { sprintf(be, "p%d", part); - if (isdigit(pe[-1])) - sprintf(pe, "p%d", part); - else - sprintf(pe, "%d", part); + if (path) { + if (isdigit(pe[-1])) + sprintf(pe, "p%d", part); + else + sprintf(pe, "%d", part); + } } /* FIXME test if really is md device ?? */ unlink(base);