| To: | xfs@xxxxxxxxxxx |
|---|---|
| Subject: | [PATCH 2/2][xfstests] fstrim: Use strtoull instead of strtoul |
| From: | Lukas Czerner <lczerner@xxxxxxxxxx> |
| Date: | Mon, 5 Sep 2011 16:28:51 +0200 |
| Cc: | aelder@xxxxxxx, Lukas Czerner <lczerner@xxxxxxxxxx> |
| In-reply-to: | <1315232931-26770-1-git-send-email-lczerner@xxxxxxxxxx> |
| References: | <1315232931-26770-1-git-send-email-lczerner@xxxxxxxxxx> |
When we are parsing input arguments we should really use stroull to get
unsigned long long numbers, since this is what we can specify on the
command line. With this fix it should parse long numbers on the 32 bit
architecture correctly.
Signed-off-by: Lukas Czerner <lczerner@xxxxxxxxxx>
---
src/fstrim.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/fstrim.c b/src/fstrim.c
index f1f37ec..e23bcb3 100644
--- a/src/fstrim.c
+++ b/src/fstrim.c
@@ -97,7 +97,7 @@ static unsigned long long get_number(char **optarg)
}
errno = 0;
- number = strtoul(opt, &end , 0);
+ number = strtoull(opt, &end , 0);
if (errno)
err_exit("%s: %s (%s)\n", program_name,
strerror(errno), *optarg);
--
1.7.4.4
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 1/2][xfstests] Add test 257: Check proper FITRIM argument handling, Lukas Czerner |
|---|---|
| Next by Date: | [PATCH] xfs: fix possible overflow in xfs_ioc_trim(), Lukas Czerner |
| Previous by Thread: | [PATCH 1/2][xfstests] Add test 257: Check proper FITRIM argument handling, Lukas Czerner |
| Next by Thread: | [PATCH] xfs: fix possible overflow in xfs_ioc_trim(), Lukas Czerner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |