X-Spam-Checker-Version: SpamAssassin 3.4.0-r929098 (2010-03-30) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,J_CHICKENPOX_73, J_CHICKENPOX_83 autolearn=no version=3.4.0-r929098 Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id p87FmqrJ169226 for ; Wed, 7 Sep 2011 10:48:52 -0500 X-ASG-Debug-ID: 1315410530-54e703710000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8EEDB1994EC8; Wed, 7 Sep 2011 08:48:51 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id VGlN0C7DxoYGgIRI; Wed, 07 Sep 2011 08:48:50 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p87Fmowd010882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 7 Sep 2011 11:48:50 -0400 Received: from dhcp-27-109.brq.redhat.com (dhcp-1-248.brq.redhat.com [10.34.1.248]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p87Fmkp7023829; Wed, 7 Sep 2011 11:48:49 -0400 From: Lukas Czerner To: xfs@oss.sgi.com Cc: aelder@sgi.com, Lukas Czerner X-ASG-Orig-Subj: [PATCH 2/2 v2][xfstests] fstrim: Use strtoull instead of strtoul Subject: [PATCH 2/2 v2][xfstests] fstrim: Use strtoull instead of strtoul Date: Wed, 7 Sep 2011 17:48:43 +0200 Message-Id: <1315410523-23925-2-git-send-email-lczerner@redhat.com> In-Reply-To: <1315410523-23925-1-git-send-email-lczerner@redhat.com> References: <1315410523-23925-1-git-send-email-lczerner@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1315410531 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean 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 --- 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