diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-08-22 10:04:55 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2008-08-22 10:04:55 +0200 |
commit | f46a8a98a79afcbb9e9910d7d71c1f8ef4e6637f (patch) | |
tree | 75d68cd50d5bd0e34801f944ea1230c3ca522ca6 /extras/volume_id | |
parent | 4ade7486a562821df5b337cb238c7c69267dd1fc (diff) |
vol_id: make the --offset= argument optional
Diffstat (limited to 'extras/volume_id')
-rw-r--r-- | extras/volume_id/vol_id.c | 5 |
1 files changed, 3 insertions, 2 deletions
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] <device>\n" |