From f46a8a98a79afcbb9e9910d7d71c1f8ef4e6637f Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Fri, 22 Aug 2008 10:04:55 +0200 Subject: vol_id: make the --offset= argument optional --- extras/volume_id/vol_id.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'extras/volume_id') diff --git a/extras/volume_id/vol_id.c b/extras/volume_id/vol_id.c index 60428ab582..b3f810fc9d 100644 --- a/extras/volume_id/vol_id.c +++ b/extras/volume_id/vol_id.c @@ -134,7 +134,7 @@ int main(int argc, char *argv[]) { "export", 0, NULL, 'x' }, { "skip-raid", 0, NULL, 's' }, { "probe-all", 0, NULL, 'a' }, - { "offset", 1, NULL, 'o' }, + { "offset", 2, NULL, 'o' }, { "help", 0, NULL, 'h' }, {} }; @@ -196,7 +196,8 @@ int main(int argc, char *argv[]) probe_all = 1; break; case 'o': - offset = strtoull(optarg, NULL, 0); + if (optarg[0] != '\0') + offset = strtoull(optarg, NULL, 0); break; case 'h': printf("Usage: vol_id [options] \n" -- cgit v1.2.3-54-g00ecf