summaryrefslogtreecommitdiff
path: root/extras/volume_id/vol_id.c
diff options
context:
space:
mode:
Diffstat (limited to 'extras/volume_id/vol_id.c')
-rw-r--r--extras/volume_id/vol_id.c5
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"