diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-04-06 20:50:05 +0400 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-04-06 20:50:05 +0400 |
commit | f8d8aa1cea915ce115345e6e729eddc80e86f021 (patch) | |
tree | abceef94710d221816cf56343b7cadf10de50e5c /e2fsprogs/fsck.c | |
parent | 87fb72032e6aa6abe5ac8fb05d22f43e8dde557b (diff) |
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.c | 8 |
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 |