| To: | xfs@xxxxxxxxxxx |
|---|---|
| Subject: | [PATCH 2/2 v2][xfstests] fstrim: Use strtoull instead of strtoul |
| From: | Lukas Czerner <lczerner@xxxxxxxxxx> |
| Date: | Wed, 7 Sep 2011 17:48:43 +0200 |
| Cc: | aelder@xxxxxxx, Lukas Czerner <lczerner@xxxxxxxxxx> |
| In-reply-to: | <1315410523-23925-1-git-send-email-lczerner@xxxxxxxxxx> |
| References: | <1315410523-23925-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>
---
v2: nothing has changed
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 v2][xfstests] Add test 257: Check proper FITRIM argument handling, Lukas Czerner |
|---|---|
| Next by Date: | [PATCH] xfs: check the return value of xfs_trans_get_buf(), Chandra Seetharaman |
| Previous by Thread: | [PATCH 1/2 v2][xfstests] Add test 257: Check proper FITRIM argument handling, Lukas Czerner |
| Next by Thread: | Re: [PATCH 2/2 v2][xfstests] fstrim: Use strtoull instead of strtoul, Alex Elder |
| Indexes: | [Date] [Thread] [Top] [All Lists] |