]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
fstrim: Use strtoull instead of strtoul
authorLukas Czerner <lczerner@redhat.com>
Wed, 7 Sep 2011 15:48:43 +0000 (15:48 +0000)
committerAlex Elder <aelder@sgi.com>
Fri, 23 Sep 2011 15:56:42 +0000 (10:56 -0500)
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>
Reviewed-by: Alex Elder <aelder@sgi.com>
src/fstrim.c

index f1f37ecab884d18542067b4341dc967318699f7b..e23bcb38511b202886b230323731bebef583e434 100644 (file)
@@ -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);