public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Lukas Czerner <lczerner@redhat.com>
To: xfs@oss.sgi.com
Cc: Lukas Czerner <lczerner@redhat.com>, aelder@sgi.com
Subject: [PATCH 2/2][xfstests] fstrim: Use strtoull instead of strtoul
Date: Mon,  5 Sep 2011 16:28:51 +0200	[thread overview]
Message-ID: <1315232931-26770-2-git-send-email-lczerner@redhat.com> (raw)
In-Reply-To: <1315232931-26770-1-git-send-email-lczerner@redhat.com>

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@redhat.com>
---
 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

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      reply	other threads:[~2011-09-05 14:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-05 14:28 [PATCH 1/2][xfstests] Add test 257: Check proper FITRIM argument handling Lukas Czerner
2011-09-05 14:28 ` Lukas Czerner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1315232931-26770-2-git-send-email-lczerner@redhat.com \
    --to=lczerner@redhat.com \
    --cc=aelder@sgi.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox