aboutsummaryrefslogtreecommitdiff
path: root/e2fsprogs
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsprogs')
-rw-r--r--e2fsprogs/fsck.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c
index 0192f3cdb..7c449e3e7 100644
--- a/e2fsprogs/fsck.c
+++ b/e2fsprogs/fsck.c
@@ -169,12 +169,12 @@ static char *base_device(const char *device)
const char *disk;
int len;
#endif
- cp = str = xstrdup(device);
+ str = xstrdup(device);
- /* Skip over /dev/; if it's not present, give up. */
- if (strncmp(cp, "/dev/", 5) != 0)
+ /* Skip over "/dev/"; if it's not present, give up */
+ cp = skip_dev_pfx(str);
+ if (cp == str)
goto errout;
- cp += 5;
/*
* For md devices, we treat them all as if they were all