summaryrefslogtreecommitdiff
path: root/e2fsprogs/fsck.c
diff options
context:
space:
mode:
authorDenys Vlasenko2010-04-06 18:50:05 +0200
committerDenys Vlasenko2010-04-06 18:50:05 +0200
commitf8d8aa1cea915ce115345e6e729eddc80e86f021 (patch)
treeabceef94710d221816cf56343b7cadf10de50e5c /e2fsprogs/fsck.c
parent87fb72032e6aa6abe5ac8fb05d22f43e8dde557b (diff)
downloadbusybox-f8d8aa1cea915ce115345e6e729eddc80e86f021.zip
busybox-f8d8aa1cea915ce115345e6e729eddc80e86f021.tar.gz
libbb: add skip_dev_pfx()
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'e2fsprogs/fsck.c')
-rw-r--r--e2fsprogs/fsck.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c
index 0192f3c..7c449e3 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