diff options
author | marcel <marcel@FreeBSD.org> | 2006-10-04 18:20:25 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2006-10-04 18:20:25 +0000 |
commit | bcfb48e2eb5e6a01dcf8f984368d5c5dff75375e (patch) | |
tree | 0737832541a09369a5f355785c9cd69f725c6c84 /sbin/gpt | |
parent | c0d4b0e19f9d154eb73d29fe68f538e1fe18ee43 (diff) | |
download | FreeBSD-src-bcfb48e2eb5e6a01dcf8f984368d5c5dff75375e.zip FreeBSD-src-bcfb48e2eb5e6a01dcf8f984368d5c5dff75375e.tar.gz |
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
Diffstat (limited to 'sbin/gpt')
-rw-r--r-- | sbin/gpt/add.c | 4 | ||||
-rw-r--r-- | sbin/gpt/label.c | 4 | ||||
-rw-r--r-- | sbin/gpt/remove.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/sbin/gpt/add.c b/sbin/gpt/add.c index 37c6bc9..348989f 100644 --- a/sbin/gpt/add.c +++ b/sbin/gpt/add.c @@ -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; diff --git a/sbin/gpt/label.c b/sbin/gpt/label.c index 98cbcc7..4a793cd 100644 --- a/sbin/gpt/label.c +++ b/sbin/gpt/label.c @@ -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; diff --git a/sbin/gpt/remove.c b/sbin/gpt/remove.c index 0515fc1..381ff0b 100644 --- a/sbin/gpt/remove.c +++ b/sbin/gpt/remove.c @@ -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; |