fix remove_devices()

Don't write to 'pe' if 'path' was not specified

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
Dan Williams 2008-11-08 16:03:07 -07:00
parent 92bd8f8d3f
commit ef70b9f4ef
1 changed files with 6 additions and 4 deletions

View File

@ -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);