From f8d8aa1cea915ce115345e6e729eddc80e86f021 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 6 Apr 2010 18:50:05 +0200 Subject: libbb: add skip_dev_pfx() Signed-off-by: Denys Vlasenko --- e2fsprogs/fsck.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'e2fsprogs') 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 -- cgit v1.1