Use strtoll(3) instead of strtol(3) for the starting block or
partition size. On 32-bit platforms sizeof(long) < sizeof(off_t) and using strtol(3) would prevent partitions larger than 4G sectors or beyond 4G blocks. PR: bin/103991 MFC after: 3 days
This commit is contained in:
parent
f7a679b200
commit
c10b34ed19
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=163009
@ -163,7 +163,7 @@ cmd_add(int argc, char *argv[])
|
||||
case 'b':
|
||||
if (block > 0)
|
||||
usage_add();
|
||||
block = strtol(optarg, &p, 10);
|
||||
block = strtoll(optarg, &p, 10);
|
||||
if (*p != 0 || block < 1)
|
||||
usage_add();
|
||||
break;
|
||||
@ -177,7 +177,7 @@ cmd_add(int argc, char *argv[])
|
||||
case 's':
|
||||
if (size > 0)
|
||||
usage_add();
|
||||
size = strtol(optarg, &p, 10);
|
||||
size = strtoll(optarg, &p, 10);
|
||||
if (*p != 0 || size < 1)
|
||||
usage_add();
|
||||
break;
|
||||
|
@ -184,7 +184,7 @@ cmd_label(int argc, char *argv[])
|
||||
case 'b':
|
||||
if (block > 0)
|
||||
usage_label();
|
||||
block = strtol(optarg, &p, 10);
|
||||
block = strtoll(optarg, &p, 10);
|
||||
if (*p != 0 || block < 1)
|
||||
usage_label();
|
||||
break;
|
||||
@ -208,7 +208,7 @@ cmd_label(int argc, char *argv[])
|
||||
case 's':
|
||||
if (size > 0)
|
||||
usage_label();
|
||||
size = strtol(optarg, &p, 10);
|
||||
size = strtoll(optarg, &p, 10);
|
||||
if (*p != 0 || size < 1)
|
||||
usage_label();
|
||||
break;
|
||||
|
@ -155,7 +155,7 @@ cmd_remove(int argc, char *argv[])
|
||||
case 'b':
|
||||
if (block > 0)
|
||||
usage_remove();
|
||||
block = strtol(optarg, &p, 10);
|
||||
block = strtoll(optarg, &p, 10);
|
||||
if (*p != 0 || block < 1)
|
||||
usage_remove();
|
||||
break;
|
||||
@ -169,7 +169,7 @@ cmd_remove(int argc, char *argv[])
|
||||
case 's':
|
||||
if (size > 0)
|
||||
usage_remove();
|
||||
size = strtol(optarg, &p, 10);
|
||||
size = strtoll(optarg, &p, 10);
|
||||
if (*p != 0 || size < 1)
|
||||
usage_remove();
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user